Hi,
Have you tried activating the Stylised UI for the select field?
Hi,
Try this:
$row_index = 3;
$items = get_field( 'verzoeken' );
if ( $items ) {
$date = $items[ $row_index ]['datum'];
$description = $items[ $row_index ]['omschrijving'];
}
Hi,
You could explode the string and var_dump
the result to find the index to echo, for example:
$address = explode( ', ', $map_location['address'] );
var_dump( $address );
echo $address[1] . ' ' . $address[2];
But I would save that info in a seperate field to keep it consistent.
Hope it helps!
$map_location = get_field( 'mapx' );
echo $map_location['address'];
Hi @59lespaul,
I’m guessing that the map is inside a hidden element? What you need to do is trigger the resize event. google.maps.event.trigger(map, 'resize');
Links for further reading:
http://stackoverflow.com/questions/4064275/how-to-deal-with-google-map-inside-of-a-hidden-div-updated-picture
http://stackoverflow.com/questions/3782632/google-map-display-from-a-hidden-area
http://stackoverflow.com/questions/28030786/google-maps-api-v3-hidden-div-map-not-centered-in-div
Untested but here’s something to get you started:
$post_objects = get_field( 'testimonials_related' );
if ( $post_objects ) {
// your normal stuff here..
} else {
// no post objects found, query the post type for 4 random posts
// you should cache this query with either the object cache or transients api
// http://wordpress.stackexchange.com/questions/183698/way-to-cache-a-query-for-24-hrs
$current_post_id = get_the_id();
$testimonials = new WP_Query(
'post_type' => 'testimonials',
'post_status' => 'publish',
'posts_per_page' => 4,
'orderby' => 'rand',
'post__not_in' => array( $current_post_id ) // exclude the current post
);
if ( $testimonials->have_posts() ) {
while ( $testimonials->have_posts() ) {
$testimonials->the_post();
// display the posts...
}
wp_reset_postdata();
}
}
Hi @frances,
If i’m understanding correctly, you want to display the fieldgroup under a specific post / custom post type?
The location rule you’re looking for is the “Post is equal to” rule. That will list all post of your custom post types and the built in Post post type.
Yes, it’s possible, but you’ll have to do a bit of string matching to find the id. For example:
$video = get_field( 'oembed_video' );
preg_match('/src="(.+?)"/', $video, $matches_url );
$src = $matches_url[1];
preg_match('/embed(.*?)?feature/', $src, $matches_id );
$id = $matches_id[1];
$id = str_replace( str_split( '?/' ), '', $id );
var_dump( $id );
And then to grab the thumbnail:
<img src="http://img.youtube.com/vi/<?php echo $id; ?>/mqdefault.jpg">
More info on YouTube thumbnails:
http://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api
As @Intervik explained in his post, the fields are no longer duplicated between translations, making it very hard to maintain a website with several languages.
The website i’m working on now has 10+ languages, and every time a add a new field to a language, that field has to be manually created in every other language.
Has anyone a solution to this? Copying json field groups between translations?
Sorry for the bump, but any updates on this?
Hi @rmdev,
I’m also intrested in which capabilities you set to the user role.
Having the same problem as mountainthemes.
Hi @realnsleo,
I’ve managed to create a working solution. Thanks for pointing me in the right direction!
And Elliot, thank you so much creating this plugin.
Hi @realnsleo,
I’m having the same problem.
Could you show me the entire solution for this with the implementation of the pre-save-post filter?
Much appreciated! Thanks.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.