Retrieve a post with its ACF repeater fields in wordpress

<?php $the_query = new WP_Query(array( ‘post_type’ => ‘our-partners’, ‘posts_per_page’ => 1, ‘order’ => ‘DESC’ )); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); if( have_rows(‘slider_partenaires_hp’) ): //”slider_partenaires_hp” is the repeater field // loop through the rows of data while ( have_rows(‘slider_partenaires_hp’) ) : the_row(); // display a sub field value echo “<li … Read more

Pagination for custom post type on multisite not working

Just briefly looking at the code, the first thing I spotted is ‘post_type=game&posts_per_page=4&paged=$paged’. Because you’re using single quotes, paged will never equal the current page. You should use double quotes so the $paged variable is actually used in your query: “post_type=game&posts_per_page=4&paged=$paged” You can learn more about single quoted and double quoted strings in the PHP … Read more

If/Else not working for header

You actually doing mistake. You have to pass 3 parameters as array not like this. Use below code <?php //if is single event, guide, firm news if ( is_singular( array(‘events’,’guide’,’firm-news’) ) ) : ?> <h5 class=”event-subpage-header-title”><?php echo $title; ?></h5> <?php else : ?> <h1><?php echo $title; ?></h1> <?php endif; ?>

Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT

OK, so finally after searching for days i was able to solve my problem!! Just had to remove these two lines of code: $terms = wp_get_post_terms( $post->ID, ‘service_cat’ ); foreach($terms as $term) { With this line instead: $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); And that solved my issue!! Thanks also … Read more