ACF query-pass field value

SOLUTION: $posts = get_field(‘choose_office’); if( $posts ): foreach(array_slice($posts, 0, 1) as $post): setup_postdata($post); $post_ID = get_the_ID(); endforeach; wp_reset_postdata(); endif; $args = array( ‘meta_query’ => array( array( ‘key’ => ‘office’, // name of custom field-post object ‘value’ => $post_ID, //name of relationship field ‘compare’ => ‘LIKE’ ), ), ); Solution from question: https://stackoverflow.com/questions/46816190/using-post-id-inside-reverse-acf-relationship-querie

Autofill advanced custom field with user data

Yes, it can be done (it’s almost always true ;))… The question is how to do this? 😉 And here is the solution… You’ll have to use acf/load_field filter: function set_acf_field_default_value( $field ) { switch ( $field[‘name’] ) { case ‘name_provider’: $field[‘value’] = ‘PUT YOUR VALUE HERE’; break; } return $field; } add_filter(‘acf/load_field’, ‘set_acf_field_default_value’ ); … Read more

Make sticky post with FacetWP

Ok, I figured it out myself. So maybe I can help someone out with the same question. I made a custom field TRUE / FALSE called “featured”. In facet WP I created this query: <?php return array( ‘post_type’ => ‘custom_post_type’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( ‘is_featured’ => array( ‘key’ => ‘featured’, ‘compare’ => ‘EXISTS’ … Read more

How to pass get images in homepage also in portfolio page?

You’re saying that you’ve set images in homepage admin, so I guess you’re using static page as homepage… In such case you can use this code to show these images anywhere else on your site: <div class=”container”> <div class=”journal-block”> <div class=”row”> <?php if ( have_rows( ‘gaimages’, get_option(‘page_on_front’) ) ): ?> <?php while ( have_rows( ‘gaimages’, … Read more

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