Pin to Top Functionality using orderby custom field then event date

I had a similar aproach some days ago //….. ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘pin_clause’ = array( ‘meta_key’ => ‘pin_to_top’, ‘meta_type’ => ‘NUMERIC’, ‘meta_value_num’ => ‘1’, ‘compare’ => ‘=’ ) ), array( ‘date_clause’ => array( ‘meta_key’ => ‘_EventStartDate’, ‘meta_type’ => ‘DATETIME’, ‘meta_value’ => ‘$today’, ‘compare’ => ‘>=’ ) ) ), ‘orderby’ => array( … Read more

Can’t get ACF repeater data in category template

Finally found this solution on the ACF support forums. All I had to do was add this to my functions.php file in my custom theme: //Include CPT In Categories Pages function namespace_add_custom_types( $query ) { if( is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) { $post_types = get_post_types( ”, ‘names’ ); $query->set( ‘post_type’, $post_types); return … Read more

Advanced Custom Fields – Google Map Won’t Render Unless Variable Dumped

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

ACF order relationship by date

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’, );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)