Advanced Custom Fields and date picker, show posts only if the day is today no matter the year

It’s a little complicated, but we can do this by directly modifying the query with a filter on posts_where. We’ll start with a query for posts with a meta value of today’s date, this is assuming a date format of yyyy-mm-dd: $date_today = date(‘Y-m-d’); $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ … Read more

I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site

I’ve never actually tried this, but I think the following should work: function wpse_96096_append_author( $title, $post_id ) { if( is_feed() ) { $author = get_post_meta( $post_id, ‘{YOUR CUSTOM FIELD KEY}’, true ); $title = $title . ‘ by ‘ . $author; } return $title; } add_filter( ‘the_title’, ‘wpse_96096_append_author’, 10, 2 ); What this does is … Read more

Custom field within shortcode

If you want to put the custom fields inside the shortcode…you actually should put the custom fields inside the shortcode. Be sure that your fields content does not get echoed, according to ACFs resources you have to use get_field($field_name) within the loop. Try: <?php echo print_wp_cart_button_for_product(get_field(‘product_name’), get_field(‘product_price’)); ?>