Skip Navigation

[Resolved] Search not allowing all categories on individual category page

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 15 replies, has 3 voices.

Last updated by Shane 5 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1163982

I am trying to:
Recreate the way the search worked before update where search would allow you to search any categories on any category page. Here is the site before update: hidden link
You can see in the red box on the top left, you can use the drop down to search any categories

Link to a page where the issue can be seen:
On this site where the updates have been done, you can see that the red search box has the category "Carts" already selected and you can't select any other category.

This page is being displayed with a custom php template called taxonomy-bg-category-carts.php both before and after the update.

In the view, I have chosen "Let me choose individual settings manually" and "Always show all values for inputs". And within the Views shortcode, I have also put hide_empty="false". Is there anything I can do to get the search form to show all categories again?

Thanks in advance for your help.

#1164118

Hi, the normal workflow in Toolset is to use a WordPress Archive on these category archive pages. However, it is not possible in the current software to include a category select field in a custom search WordPress Archive for categories. Instead, you can insert a View that includes a custom category search. That should be okay. Can you tell me more about how this View is inserted in the page? You mentioned a PHP template file. Can you share any custom code used to insert this View? Can you share any shortcodes used in wp-admin to insert this View? Are the search form and results inserted with separate shortcodes? Try adding cached="off" to the shortcode or shortcodes used to insert this View.

#1164772
Widgets ‹ TRSA Buyers Guide — WordPress.png

Hi Christian, Thanks for your quick replay. The view is being inserted through a sidebar widget. I've added a screenshot here.
The view is called "Search Form". I tried adding it with the cached="off" both through a shortcode in the sidebar widget and through the PHP template, and it didn't have any effect. Here is the link to my test site where the updates have been done:
hidden link
You can see that you can only choose carts.
The code for the PHP template is below. Thanks so much for your help!

<?php get_header(); ?>
<?php dynamic_sidebar( 'leadbanner' ); ?>
  <div id="content">
<!---Enhanced Listing Area Begins Here-->
    <?php $posts = query_posts( $query_string . '&orderby=title&order=asc&post_type=enhanced-listing' ); ?>  
	<?php if( $posts ) : ?>
	<h2 class="enhanced">Featured <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?> Listings</h2>
	<ul class="enhanced">
	  <?php while(have_posts()) : the_post();?>
		<?php $company = toolset_get_related_post(get_the_ID(), array('company', 'enhanced-listing'));?>
      <li class="profile">
        <div class="oneThirds">
          <ul class="logoBtns">
            <li><?php echo types_render_field ("company-logo", array( "post_id"=>$company)); ?></li>
            <li><button><a class="btn" href="<?php $company_id = wpcf_pr_post_get_belongs(get_the_ID(), 'company'); echo get_permalink($company_id); ?>">Full Profile</a></button></li>
            <li><button onclick="modalrequest()" style="display:inline-block;">Request Information</button></li>
            <li><button onclick="modalfriend()" style="display:inline-block;">Send to a Friend</button></li>
          </ul>    
        </div>
        <div class="twoThirds">
          <div class="leftHalf">
            <p class="company"><?php echo types_render_field("company-name", array( "post_id"=>$company)); ?></p>
            <div class="address"><?php echo types_render_field ("address-line-1", array( "output" => "html","post_id"=>$company)); ?><?php echo types_render_field("address-line-2", array( "output" => "html","post_id"=>$company)); ?><?php echo types_render_field("address-line-3", array( "output" => "html","post_id"=>$company)); ?><br><?php echo types_render_field("city", array( "output" => "html","post_id"=>$company)); ?><?php echo types_render_field("state", array( "output" => "html","post_id"=>$company)); ?> <?php echo  types_render_field("zip-code", array( "post_id"=>$company)); ?></div>
            <div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html","post_id"=>'$company')); ?> <?php echo types_render_field("toll-free-number", array( "output" => "html","post_id"=>$company)); ?></div>
            <div class="fax"><?php echo types_render_field("fax-number", array( "post_id"=>$company)); ?></div>
          </div>
          <div class="rightHalf">
            <ul class="social">
              <li><?php echo types_render_field("company-website", array( "title" => "Website", "target" => "_blank", "class" => "website","post_id"=>$company)); ?></li>
              <li><?php echo types_render_field("facebook-page", array( "title" => "Facebook", "target" => "_blank", "class" => "facebook","post_id"=>$company)); ?></li>
              <li><?php echo types_render_field("twiter-page", array( "title" => "Twitter", "target" => "_blank", "class" => "twitter","post_id"=>$company)); ?></li>
              <li><?php echo types_render_field("linkedin-page", array( "title" => "LinkedIn", "target" => "_blank", "class" => "linkedin","post_id"=>$company)); ?></li>
              <li><?php echo types_render_field("youtube-page", array( "title" => "YouTube", "target" => "_blank", "class" => "youtube","post_id"=>$company)); ?></li>
            </ul>
          </div>
          <div class="clearAll"></div>
          <div class="companyDesc"><?php echo types_render_field("company-description", array("output" => "html","post_id"=>$company)); ?></div>
        </div>
        <div class="clearAll"></div>
      </li>
	  <?php endwhile; ?>
    </ul>
  <div id="modalbak"></div>
  <div id="modalwinreq">
    <div id="modalmsg"><?php cred_form(605); ?></div>
  </div>
  <div id="modalwinfri">
    <div id="modalmsg"><?php cred_form(1117); ?></div>
  </div>
    <?php else : ?>    
    <?php endif; ?>
<!---Product Showcase Area Begins Here-->
	<?php $posts = query_posts( $query_string . '&orderby=date&order=desc&post_type=product' ); ?>
    <?php if( $posts ) : ?>
    <h2 class="showcase">Product Showcase: <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?></h2>	  
    <ul class="bxslider">
	<?php while(have_posts()) : the_post(); ?> 
		
		<?php $company = toolset_get_related_post(get_the_ID(), array('company', 'product'));?>
    
      <li>
        <div class="slideInt">
          <div class="showLeft"><?php echo types_render_field ("product-image"); ?></div>
          <div class="showRight">
            <p class="company"><?php echo types_render_field("company-name", array( "id"=>$company)); ?></p>
			<div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html","id"=>$company)); ?></div><div class="fullList"><a href="<?php echo get_permalink($company); ?>">Full Profile</a></div>
			<?php echo types_render_field("product-description"); ?>
          </div>
          <div class="clearAll"></div>
        </div>             
      </li>    
  <?php endwhile; ?>
    </ul>	
  <?php else : ?>
  <?php endif; ?>
<!---Regular Listing Area Begins Here-->
    <div id="catAdWrap">
      <div id="ad_sidebar">
        <?php dynamic_sidebar( 'productshowcase' ); ?>
      </div>
      <div id="catListWrap">
        <h2><a href="/bg-category/carts/basketliners-covers">Carts, Basketliners, Covers Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'basketliners-covers', 'orderby' => 'title', 'order' => 'asc' ) ); ?>
        <?php if ( have_posts() ) : ?>
		<ul>
		<?php while ( have_posts() ) : the_post(); ?>        
          <li>
            <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
            <div class="address"><?php echo types_render_field ("address-line-1", array( "output" => "html")); ?><?php echo types_render_field("address-line-2", array( "output" => "html")); ?><?php echo types_render_field("city", array( "output" => "html")); ?><?php echo types_render_field("state", array( "output" => "html")); ?> <?php echo  types_render_field("zip-code"); ?></div>
            <div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html")); ?></div><div class="fullList"><a href="<?php the_permalink(); ?>">Full Profile</a></div>
          </li>        
        <?php endwhile; ?>
        </ul>
        <?php else : ?>
        <h3><?php _e('Not Found'); ?></h3>
        <?php endif; wp_reset_query(); ?>    
        <h2 style="margin-top:0.83em;"><a href="/bg-category/carts/cart-handling-equipment">Carts, Cart Washers Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'carts-cart-washers', 'orderby' => 'title', 'order' => 'asc' ) ); ?>
        <?php if ( have_posts() ) : ?>
		<ul>
		<?php while ( have_posts() ) : the_post(); ?>        
          <li>
            <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
            <div class="address"><?php echo types_render_field ("address-line-1", array( "output" => "html")); ?><?php echo types_render_field("address-line-2", array( "output" => "html")); ?><?php echo types_render_field("city", array( "output" => "html")); ?><?php echo types_render_field("state", array( "output" => "html")); ?> <?php echo  types_render_field("zip-code"); ?></div>
            <div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html")); ?></div><div class="fullList"><a href="<?php the_permalink(); ?>">Full Profile</a></div>
          </li>        
        <?php endwhile; ?>
        </ul>
        <?php else : ?>
        <h3><?php _e('Not Found'); ?></h3>
        <?php endif; wp_reset_query(); ?>
  <h2 style="margin-top:0.83em;"><a href="/bg-category/carts/cart-handling-equipment">Carts, Cart Handling Equipment Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'cart-handling-equipment', 'orderby' => 'title', 'order' => 'asc' ) ); ?>
        <?php if ( have_posts() ) : ?>
		<ul>
		<?php while ( have_posts() ) : the_post(); ?>        
          <li>
            <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
            <div class="address"><?php echo types_render_field ("address-line-1", array( "output" => "html")); ?><?php echo types_render_field("address-line-2", array( "output" => "html")); ?><?php echo types_render_field("city", array( "output" => "html")); ?><?php echo types_render_field("state", array( "output" => "html")); ?> <?php echo  types_render_field("zip-code"); ?></div>
            <div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html")); ?></div><div class="fullList"><a href="<?php the_permalink(); ?>">Full Profile</a></div>
          </li>        
        <?php endwhile; ?>
        </ul>
        <?php else : ?>
        <h3><?php _e('Not Found'); ?></h3>
        <?php endif; wp_reset_query(); ?>
        <h2 style="margin-top:0.83em;"><a href="/bg-category/carts/carts-and-hand-trucks">Carts, Carts and Hand Trucks Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'carts-and-hand-trucks', 'orderby' => 'title', 'order' => 'asc' ) ); ?>
        <?php if ( have_posts() ) : ?>
		<ul>
		<?php while ( have_posts() ) : the_post(); ?>        
          <li>
            <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
            <div class="address"><?php echo types_render_field ("address-line-1", array( "output" => "html")); ?><?php echo types_render_field("address-line-2", array( "output" => "html")); ?><?php echo types_render_field("city", array( "output" => "html")); ?><?php echo types_render_field("state", array( "output" => "html")); ?> <?php echo  types_render_field("zip-code"); ?></div>
            <div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html")); ?></div><div class="fullList"><a href="<?php the_permalink(); ?>">Full Profile</a></div>
          </li>        
        <?php endwhile; ?>
        </ul>
        <?php else : ?>
        <h3><?php _e('Not Found'); ?></h3>
        <?php endif; wp_reset_query(); ?>           
      </div>
      <div class="clearAll"></div>
    </div>    
  </div>
  <div class="clearAll"></div>
</section>
<?php get_footer(); ?> 
#1164940

Hi, after a bit more investigation it turns out this is a known issue. This behavior has been reported to our developers already and is listed as a bug. Unfortunately I don't have an ETA for a fix, but I will keep you posted here as I receive more information.

#1164975

Okay, I was afraid of that. Thanks for letting me know!

#1189954

Hi, just a quick update to let you know this issue has been marked for resolution in Views 2.7.3. I don't have an ETA just yet, but I will keep you posted here.

#1189955

Great news! My client will be very happy. Thanks for letting me know!

#1200558

Hi, Views 2.7.3 is now available for download at https://toolset.com/account/downloads and will be available for automatic update later today. Please update to the latest version of all Toolset plugins and let me know if the problem is not completely resolved.

#1200685
category-dropdown-not-working.gif

Christian, thanks for keeping me updated on this. I was so excited to get your message and tested it on my site, but it is still not working. As you can see from the red filter/search box on the upper left side, the category is still only showing the current category, and does not allow all the categories in the drop down like it does on the home page:hidden link
I updated Views & Types. I tried updating Forms as well from 2.2.1.1 but got this error message: "Update Failed: The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature" but I don't know if that's relevant. Thanks for your help!

#1200691

I don't think the Forms package failure would be related. Try clicking "Check for Updates" again a few times and if it still has trouble downloading that package, you can download a fresh copy from https://toolset.com/account/downloads instead. Deactivate and delete the old plugin, then install the new one with the zip file you downloaded.

May I log in to this dev site and see what's going on? In my local tests this solved the problem but I must be missing something.

#1201121
Edit Company ‹ TRSA Buyers Guide — WordPress(1).png
Edit Company ‹ TRSA Buyers Guide — WordPress.png

Hi Christian, I just noticed another problem with the most recent update. Now the custom fields of Company Name (which I mentioned before is no longer working in search box) is also not working when you edit the Company CPT. I'll attach images to show you what I mean.

#1201830

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Laura,

As christian is unavailable at this time I will be handling his queue.

I was able to fix the Category filter by removing it completely and re-adding to the view.

Also For the company name field I see that it is using an empty select field type this is why it is not displaying correctly.

hidden link

Not sure if this was changed but what was this field before ?

Please let me know.
Thanks,
Shane

#1201872

Hi Shane. Thanks for stepping in. Hmm, that's weird. It must have gotten messed up in the update. Before it was using a single line field type. Since I can't change the field type for the custom field, I tried changing the slug of the original field and creating a new field with the original slug that used the single field, but it won't let me use the original slug. Wondering how to fix this? And now, that search box isn't even showing on the Carts page. hidden link Seems like this update has caused a lot of problems.

#1202005

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Laura,

I can look at all these for you. Can you recall what was the slug of the original Company Name Field ?

Also could you link me to the backend edit page for the Cart Page? Wasn't able to find it here hidden link

Thanks,
Shane

#1202007

Thanks, Shane. It was "company-name". Let me know if I can help you with how things were set up.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.