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

How to access advance custom fields with post type in a for each loop

<?php $slider = get_posts( $slider = g array( ‘post_type’ => ‘event’, ‘posts_per_page’ => – 1 )); ?> <?php $count = 0; ?> <?php foreach($slider as $slide): ?> <?php setup_postdata( $slide); $title = the_field(‘event_name’); ?> <?php endforeach; ?> <?php wp_reset_postdata(); ?> Or <?php $slider = get_posts( $slider = g array( ‘post_type’ => ‘event’, ‘posts_per_page’ => – … Read more

Show specific posts with WP_Query using ACF Post object

now we are getting there.. you really need to try to explain, what your problem is, its not very clear in your question. my assumption is, you tried this one, but it didn’t work out: foreach( $post_objects as $post_object): get_template_part( ‘includes/content’, get_post_format( $post_object->ID ) ); endforeach; and here is why: you call the template, but … Read more