Tagged: x
-
AuthorPosts
-
June 30, 2016 at 2:41 pm #1067216
Hi guys,
We used to have a file in our child theme called “category-53.php”, this file allowed to have a different template for a specific category.
This is what the file looks like :
<?php // ============================================================================= // VIEWS/INTEGRITY/WP-INDEX.PHP // ----------------------------------------------------------------------------- // Index page output for Integrity. // ============================================================================= ?> <?php get_header(); ?> <div class="x-container max width offset"> <div class="x-main full" role="main"> <?php x_get_view( 'global', '_index' ); ?> </div> </div> <?php get_footer(); ?>
For an unknown reason, today we started receiving an empty white page on this specific category. It looks like this file /wp-includes/template-loader.php is trying to open this file: wp-content/themes/x-child-integrity-dark/index.php but the second file is not there, and has never been.
I suspected that WordPress might have changed some kind of logic with v4.5.3, but it doesn’t look like it. I’ve checked in the WordPress Codex (https://codex.wordpress.org/Category_Templates)…
The Template Hierarchy specifies that WordPress will use the first Template file it finds in your current Theme’s directory from the following list:
category-slug.php
category-ID.php
category.php
archive.php
index.phpWhen we remove the file “category-53.php” our category page starts to load again, even without the index.php file. We’ve contacted our hosting provider and they suggested to contact you. Is there anything we should be aware of regarding category overrides?
URL : http://www.trashfamily.com/category/evenements/
Note : We currently added the file “index.php” from the parent theme as a fallback to be able to load the page or else we’d get a fatal error.
Waiting on your feedback!
Best regards,
BastienJune 30, 2016 at 9:08 pm #1067796Hi There,
Thanks for writing in.
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
June 30, 2016 at 9:28 pm #1067811This reply has been marked as private.July 1, 2016 at 2:16 am #1068049Hi there,
Provided login is incorrect, but I think I know the issue 🙂
Please edit this file,
\wp-content\themes\x\framework\functions\global\plugins\wpml.php
And remove this code,
if( is_search() || is_archive() ) { $p = pathinfo($template); return $p['dirname'].'/index.php'; }
That should let it use the default template. That code was added due to how WPML handle the templates, but it causes another set of issues. It’s already on our bug list 🙂
Thanks!
July 1, 2016 at 1:40 pm #1068709Hey Rad!
Sorry for the incorrect login but your guess was right, this snippet was the culprit. After commenting out these lines our template started to load as usual.
Thank you for the help!
Kind regards,
BastienJuly 1, 2016 at 3:31 pm #1068820Glad to hear it.
Let us know if you need help with anything else
Joao
-
AuthorPosts