Add a mailto button next to custom field download link
Add a mailto button next to custom field download link
Add a mailto button next to custom field download link
Try this code: <div class=”map”> <?php global $post; $location = get_field(‘location’, $post->ID); ?> <div class=”acf-map”> <div class=”marker” data-lat=”<?php echo $location[‘lat’]; ?>” data-lng=”<?php echo $location[‘lng’]; ?>”></div> </div> </div> Sometimes in the template you’re loading this you don’t have the post that the field belongs to, so you can try to fetch it in the global $post … Read more
Values show up in custom home page but not in custom post pages
Your is_int function is always returning true, because $count/2 is always an integer. is_int from the looks of it, just returns true if the parameter supplied is a number (integer), or false, if its anything else (string). Try changing if(is_int($count / 2)){ … } to if($count % 2 == 0) { //Code for even result … Read more
Advanced Custom Fields does not automatically output the fields you add in the_content(). You need to use ACF’s template functions. Refer to the documentation for more. Based on your comment, yours will look something like: <div class=”contentarea”> <div id=”content” class=”content_right”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div id=”post-<?php … Read more
The $journalEntries IDs are a post_type = post? Because if you don’t specify the post_type in the WP_Query it will default to ‘post’. So your $args array should be: $args = array( ‘post_type’ => ‘put_post_type_here’, ‘post__in’ => $journalEntries, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, );
If editing the theme files, chances are you want to place your custom block of code right after a line of code that might look something like: <?php get_template_part( ‘content/entry’ ); ?> It should also be before any call to the function comments_template() if you want it to show before the comments. You mention using … Read more
In ACF, how to show custom category selection tab upon selecting a main category
One simple solution: create a custom post type for each level, and use CPT permissions so you can assign them rights to only edit their level of CPT and never see the others. You can then assign a different ACF fieldset for each post type. Use the same names for fields within the fieldsets, and … Read more
There are something wrong in your code, Here I edited what you tried, function rohs_update_title($post_ID){ $post_type = get_post_type($post_ID); // If this isn’t a ‘rohs_menu’ post, don’t update it. if ( “rohs_menu” != $post_type ) return; $postAuthorId = get_post_field( ‘post_author’, $post_ID ); // get the post author ID $userToGetData=”user_”.$postAuthorId; $restaurantName = get_field( ‘nom_restaurant’, $userToGetData ); $date … Read more