Show only the future event (Advanced Custom Fields)

You need a meta query. There’s also documentation on ACF for querying dates. <?php $event = new WP_Query( array( ‘post_type’ => ‘gacr-event’, ‘posts_per_page’ => 5, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, ‘meta_query’ => array( array( ‘key’ => ‘date’, ‘type’ => ‘NUMERIC’, // MySQL needs to treat date meta values as numbers ‘value’ => current_time( ‘Ymd’ … Read more

ACF: Querying relationship fields with Author

The users doesn’t have permalinks nor titles. They have author links and display names. Changed the code: <?php while ( have_posts() ) : the_post(); ?> <h2>Resturants</h2> <?php $resturants = get_users(array( // Changed from get_posts ‘fields’ => ‘all_with_meta’, // All with meta to get also display_name ‘meta_query’ => array( array( ‘key’ => ‘resturant’, // name of … Read more

Hide ACF from source code until a “show” button is clicked

You’re going to need to $.ajax() the contents of the field(s) on a click. In a nutshell: In your page template <?php global $post; $post_id = $post->ID; ?> <button class=”acf-get-content-button”>Let’s see that content</button> <div id=”acf-content-wrapper” data-id=”<?php echo $post_id; ?>”></div> JS (function($) { $(‘.acf-get-content-button’).click(function(e){ e.preventDefault(); var $contentWrapper = $( ‘#acf-content-wrapper’ ); var postId = $contentWrapper.data( ‘id’ … Read more

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