Tagged: x
-
AuthorPosts
-
December 3, 2016 at 8:54 pm #1280205
2342JParticipantI have created a set of custom post types using CPT UI. Which works. For example I have “route” and “country.”
To create a template for “route” posts I duplicated the following files into my child theme in the same directory:
1) single.php becomes single-route.php
2) In single-route.php I updated the code from:
<?php x_get_view( x_get_stack(), 'wp', 'single' ); ?>to this:
<?php x_get_view( x_get_stack(), 'wp', 'single-route' ); ?>3) content.php becomes content-route.php
4) I updated the following code in content-route.php from:
<?php x_get_view( 'ethos', '_content', 'post-header' ); ?>to this:
<?php x_get_view( 'ethos', '_content', 'route', 'post-header' ); ?>4) wp-single.php becomes wp-single-route.php
All of that worked, my new template applied to the “route” custom post type.
Now, when I repeated that process substituting “country” in place of route it does not work for me. The country posts return a 500 error.
Is there something I am missing?
Thanks for the help.
December 4, 2016 at 2:07 am #1280311
Rue NelModeratorHello There,
Thanks for writing in! Error 500 usually means a fatal error. Can you please enable WP_DEBUG mode? You can do this by opening
wp-config.phpand adding
define( 'WP_DEBUG' , true );just above/* That's all, stop editing! Happy blogging. */For example:define('WP_DEBUG', true); /* That's all, stop editing! Happy blogging. */When you revisit the page with the error 500, you should have some error output describing the issue in more detail.
Please let us know how it goes.
December 4, 2016 at 9:31 am #1280515
2342JParticipantOk, so I’m on IIS but I was able to pull the PHP error log:
[04-Dec-2016 15:23:17 UTC] PHP Parse error: syntax error, unexpected ''single-country’ ); ?> ' (T_ENCAPSED_AND_WHITESPACE) in D:\home\site\wwwroot\wp-content\themes\x-child\single-country.php on line 17This is my line 17 (the very end):
<?php // ============================================================================= // SINGLE-COUNTRY.PHP // ----------------------------------------------------------------------------- // Handles output of individual countries. LANDON // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's posts, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-single-country.php," where you'll be able to find the // appropriate output. // ============================================================================= ?> <?php x_get_view( x_get_stack(), 'wp', 'single-country’ ); ?>Honestly I’m stuck. Everything looks right to me.
December 4, 2016 at 9:45 am #1280524
ThaiModeratorPlease replace your code with this:
<?php x_get_view( x_get_stack(), 'wp', 'single-country' ); ?>Hope it helps 🙂
December 4, 2016 at 9:52 am #1280530
2342JParticipantThat worked. I don’t understand, to my eye that’s identical. What’s the difference here?
December 4, 2016 at 10:13 am #1280550
ThaiModeratorHi There,
The different is
’vs'.Cheers!
December 18, 2016 at 12:50 pm #1297307
2342JParticipantResolved. Thank you so much.
December 18, 2016 at 5:55 pm #1297456
Rue NelModeratorYou are most welcome!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1280205 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
