• Resolved naveenkmoorthy

    (@naveenkmoorthy)


    I’m using two forms for two custom post types. I successfully customized results page for one custom post. Here is my code

    <?php
            if (have_posts ()) {
    
                while (have_posts ()) {
    
                    (the_post());
            ?>
            <?php if($_GET['s']=='uwpsfsearchtrg'){
              //add your own result display here. or you can include the template here as well.
              ?>
              <a class="event-link" href="<?php the_permalink();?>">
              <div class="resource-box">
              <h4><?php the_title(); ?></h4>
              <?php the_excerpt(); ?>
              <ul>
                <li><strong>Eligibility:</strong> <?php echo get_post_meta( get_the_id(), 'eligibility', true); ?></li>
                <li><strong>Phone Number:</strong> <?php echo get_post_meta( get_the_id(), 'phone_number', true); ?></li>
                <li><strong>Coverage Area:</strong> <?php echo get_post_meta( get_the_id(), 'coverage_area', true); ?></li>
                <li><strong>Age Served:</strong> <?php echo get_post_meta( get_the_id(), 'age_served', true); ?></li>
              </ul>
              </div>
            </a>
              <br>
        <?php
        }else{
    
          ?>

    My question is how to filter the search results for the 2nd custom post?

    http://ww.wp.xz.cn/plugins/ultimate-wp-query-search-filter/

Viewing 1 replies (of 1 total)
  • Thread Starter naveenkmoorthy

    (@naveenkmoorthy)

    Found it myself. I used a conditional statement like this

    <?php if ('post_resources'==get_post_type()) {
                # code...
              ?>

    Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Multiple Forms’ is closed to new replies.