Skip Navigation

[Resolved] Update broke category php templates

This support ticket is created 6 years, 2 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 6 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1158198

I am trying to: update WordPress core & Toolset

Link to a page where the issue can be seen: hidden link

I expected to see: (same as before update) hidden link

Instead, I got: I am using a custom php file to show this page. It's called taxonomy-bg-category-garments-uniforms.php. When I updated core and Toolset Types, Views, and CRED, this page (and others like it) broke. Is there anything different needed in the PHP pages since the updates?

#1158216

If it helps, here is the file that generates that page that no longer seems to work although it is the same as before:

<?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(); ?>
      <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(); ?>      
    
      <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( "post_id"=>'$company')); ?></p>
			<div class="phone"><?php echo types_render_field("main-phone-number", array( "output" => "html","post_id"=>'$company')); ?></div><div class="fullList"><a href="<?php $company_id = wpcf_pr_post_get_belongs(get_the_ID(), 'company'); echo get_permalink($company_id); ?>">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/garments-uniforms/garments-100-polyester">Garments, 100% Polyester Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-100-polyester', '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/garments-uniforms/garments-career-and-casual-apparel">Garments, Career and Casual Apparel Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-career-and-casual-apparel', '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/garments-uniforms/garments-chef-apparel">Garments, Chef Apparel Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-chef-apparel', '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/garments-uniforms/garments-cleanroom">Garments, Cleanroom Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-cleanroom', '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/garments-uniforms/garments-coveralls">Garments, Coveralls Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-coveralls', '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/garments-uniforms/garments-healthcare">Garments, Healthcare Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-healthcare', '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/garments-uniforms/garments-hospitality">Garments, Hospitality Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-hospitality', '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/garments-uniforms/garments-industrial">Garments, Industrial Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-industrial', '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/garments-uniforms/garments-linen-supply">Garments, Linen Supply Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-linen-supply', '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/garments-uniforms/garments-specialty">Garments, Specialty Listings</a></h2>
        <?php query_posts( array( 'post_type' => 'company', 'bg-category' => 'garments-specialty', '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(); ?> 
#1158543

Hi,

How do you setup the custom taxonomy "bg-category"? is it created with Types plugin?

If it is, I have tried below steps, but theme file "taxonomy-bg-category-garments-uniforms.php" works just fine in my localhost with the latest version of WordPress + Toolset plugins.

Here are detail steps, please correct me if there is anything missing:
1) Create a custom taxonomy:
- slug: bg-category
- enable option "rewrite"
Replace taxonomy slug with this: commercial-laundry

2) Create some posts, assign with term "garments-uniforms" of taxonomy "bg-category"

3) Create a theme file "taxonomy-bg-category-garments-uniforms.php"
Test the term "garments-uniforms" archive page in front-end
I can see it does output content from theme file "taxonomy-bg-category-garments-uniforms.php"

And I suggest you try these in your website:
In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again

#1158835

Hi Luo,
Thanks for your reply.
1) Yes, there is a custom taxonomy made with Toolset. The slug is bg-categroy. Rewrite is enabled. I'm confused about replacing it with the slug commercial-laundry. Did you want me to do that in Toolset under "edit taxonomy" or in the PHP file?

2) I have CPT called "Showcases" which have the category "garments-uniforms" of taxonomy "bg-category". You can see them on this page: hidden link under Products Showcase. However, in the theme before the update, they are showing as a slideshow and after the update, they are showing as a list. So, the items are showing, but how do I get them to show as a slideshow again?

The theme and plugins are exactly the same as the old site: hidden link. Everything was working until I did the core and the Toolset update. No themes or plugins have changed. After the update I have two problems:
#1) The Product Showcase is showing as a list rather than a slider as I indicated above
#2) The "Featured Garments, Uniforms Listing", which is at the top of the page, is no longer being filled out. This was working until I updated the CRED (Toolset Forms) plugin.

Any ideas on how to get these two things to work again? Thanks so much!

#1159354

No, you don't need to change the rewrite rule, the word "commercial-laundry" is from the URL you mentioned above:
hidden link

By default, the taxonomy archive page should use the taxonomy slug "bg-category" in the URL.

Since it is a compatibility problem with your theme files, please check these:
1) In case there is other compatibility problems in your website, please deactivate other plugins, and test again
2) If the problem still persists, please a copy of your website, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/