Support

Account

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”>

      <?php
      while ( $the_query->have_posts() ) { $the_query->the_post();
      get_template_part( ‘content’, $templ);
      }
      ?>

    <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();
    ?>