Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1271463
    Daniel W
    Participant

    Hi Guys,

    I was wondering why my project-category pages broke after the theme update.

    Plugin:
    Projects by WooThemes

    The problem in my case was the wpml.php
    x/framework/global/plugins/wpml.php

    // Add template override to force WPML to use the correct search & archive templates
    // ======================================================================================
    
    add_filter( 'template_include', 'x_force_template_override', 99 );
    
    function x_force_template_override( $template ) {
    	
      if ( x_is_shop() || x_is_product_category() || x_is_product_tag() )  return $template;
      
      if( is_search() || is_archive() ) {
        $p = pathinfo($template);
        return $p['dirname'].'/index.php';
      }
    
      return $template;
    }
    

    After delete this code, it works fine.

    Please can you give me a solution for my child theme so that I doesn’t overwrite after a theme update.

    #1271726
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    Please add this code to your child theme’s functions.php

    add_action('init', 'project_category_template_fix', 99999 );
    
    function project_category_template_fix () {
    
    remove_filter( 'template_include', 'x_force_template_override', 99 );
    
    }

    Or if you just wish to disable it for project-category

    add_action('init', 'project_category_template_fix', 99999 );
    
    function project_category_template_fix () {
    
    if ( is_tax( 'project-category' ) || is_tax( 'project_category' ) ) remove_filter( 'template_include', 'x_force_template_override', 99 );
    
    }

    Hope this helps.

    #1280591
    Daniel W
    Participant

    Hi Rad,

    thanks for your replay.

    For your information, first code is working. Second break the template.

    Thanks,
    Pascal

    #1280760
    Rue Nel
    Moderator

    Hello Pascal,

    Sorry if the second one didn’t work out. There was a typographic error in the code. Please use this instead:

    add_action('init', 'project_category_template_fix', 99999 );
    
    function project_taxonomy_template_fix () {
    
      if ( is_tax( 'project-category' ) || is_tax( 'project_category' ) ) {
        remove_filter( 'template_include', 'x_force_template_override', 99 );
      }
    
    }

    Please let us know if this works out for you.

    #1281421
    Daniel W
    Participant

    Hi Rue,

    thanks for your replay. Just for your information this code breake the projects page.

    Thanks,
    Pascal

    #1282438
    Lely
    Moderator

    Hello Pascal,

    Can you clarify how the codes break the project page? Can you give us the error or the maybe the screenshots?

  • <script> jQuery(function($){ $("#no-reply-1271463 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>