Tagged: x
-
AuthorPosts
-
November 26, 2016 at 9:04 am #1271463
Daniel WParticipantHi Guys,
I was wondering why my project-category pages broke after the theme update.
Plugin:
Projects by WooThemesThe 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.
November 26, 2016 at 6:38 pm #1271726
RadModeratorHi 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.
December 4, 2016 at 11:15 am #1280591
Daniel WParticipantHi Rad,
thanks for your replay.
For your information, first code is working. Second break the template.
Thanks,
PascalDecember 4, 2016 at 4:35 pm #1280760
Rue NelModeratorHello 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.
December 5, 2016 at 5:38 am #1281421
Daniel WParticipantHi Rue,
thanks for your replay. Just for your information this code breake the projects page.
Thanks,
PascalDecember 5, 2016 at 7:30 pm #1282438
LelyModeratorHello Pascal,
Can you clarify how the codes break the project page? Can you give us the error or the maybe the screenshots?
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1271463 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
