Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter antoniojcastiglione

    (@antoniojcastiglione)

    Found issue and resolved

    Thread Starter antoniojcastiglione

    (@antoniojcastiglione)

    Hi @stevemullen,

    Yes, purged it before alongside the caching plugin on the site. Just got it to work now! Appreciate you being so responsive.

    Many thanks,

    Thread Starter antoniojcastiglione

    (@antoniojcastiglione)

    Hi @stevemullen,

    Still seeing the 404 unfortunately. Do you know if there is a delay in the rollout of the update?

    Thanks,

    Thread Starter antoniojcastiglione

    (@antoniojcastiglione)

    @tatianahenriquezg I did not have luck with the plugin so I decided to hand code a solution. Spent several hours doing some research on queries and custom search results using forms and got it working. Below is the code I used for my results.

    <form method="get" id="search-form" action="url-of-search-page-here">
       <div class="homepg-search">
    
        <?php  wp_dropdown_categories('taxonomy=listing_type&name=listing_type'); ?>
    
        <input type="submit" value="Search" id="submitSelection" />
    
       </div>
    </form>
    <?php
    $taxID = $_GET['listing_type']; // Grabbing the custom taxonomy term id
     $state = $_GET['state']; // If using state selection
     $paged = get_query_var('paged');
     if( $taxID ) :
     $args = array( // Building the arguments for the new query
     	'post_type' => 'listing',
     	'tax_query' => array(
     		array(
     			'taxonomy' => 'listing_type',
     			'field' => 'term_id',
     			'terms' => $taxID,
     		),
     	),
     	'posts_per_page' => 20,
      'paged' => $paged
     );
    
     $rQuery = new WP_Query( $args ); // Initializing the loop
     $count = $rQuery->found_posts; // Getting total number of results
    
    else :
      $args = array(
        'post_type' => 'listing',
        'posts_per_page' => 8,
        'paged' => $paged,
        'tax_query' => array(
          array(
            'taxonomy' => 'state',
            'field' => 'slug',
            'terms' => $state,
          ),
        ),
      );
    
      $sQuery = new WP_Query( $args ); // Initializing state query loop
      $count = $sQuery->found_posts; // Getting total number of results
    endif;
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)