Home › Forums › Front-end Issues › Issues creating related posts to multiple CPT and display radio buttons select c › Reply To: Issues creating related posts to multiple CPT and display radio buttons select c
This is my code. My issues concert the else statement. I should be able to display in every Costum Post Type the related posts and for that, I need multiple options values set on.
At this moment, only type_portfolio works with single posts assigned, I mean with multiple options value set NO.
Please, URGENT
<?php
if(is_singular(‘type_portfolio’)) {
$args = array(
‘post_type’ => ‘post’,
‘meta_key’ => ‘services’,
‘meta_value’ => get_the_ID()
);
} else {
$args = array(
‘post_type’ => ‘post’,
‘posts_per_page’ => get_option(‘posts_per_page’)
);
}
$the_query = new WP_Query( $args );
$templ = “home”;
$cssclass= “grid-33 tablet-grid-100 mobile-grid-100 prefix-33 suffix-33″;
if ( $the_query->have_posts() ) {
?>
<div class=”jcarouselb”>
<span class=”fa-stack fa-lg”><i class=”fa fa-square fa-stack-2x”></i><i class=”fa fa-chevron-left fa-stack-1x”></i></span>
<span class=”fa-stack fa-lg”><i class=”fa fa-square fa-stack-2x”></i><i class=”fa fa-chevron-right fa-stack-1x”></i></span>
</div>
<?php
}
wp_reset_postdata();
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.