jamesb4551
Member
Posted 2 years ago #
OK I get how to change the single based on a category, but what if say I wanted to change the single depending on the PHP page loaded?. For example, I want a custom single.php for when register or profile.php is loaded.
(I use a plugin to customize register/login/profile already but need more control other than just css hacks)
So I duplicate single.php, make the necessary style changes and call it single-profile.php. Then I try did try adding to my single.php
<?php
if (is_page('profile.php')) {include (TEMPLATEPATH . '/single-profile.php');
}
else { include (TEMPLATEPATH . '/single.php');
}
?>
at the beggining of my single.php after calling the header.
No dice...
Any other ideas?
jamesb4551
Member
Posted 2 years ago #
Hmm still no solution for this, I have it in my single to load separate sidebars as well but it doesn't work either, any PHP/wordpres heads out there that can guide me in where I may be going wrong?
jamesb4551
Member
Posted 2 years ago #
Is there anyone that can figure out whats going wrong here?
It works when I test it locally to bring in the other sidebar but not live, what the.....
This is what I use locally and it works.
<div id="sidebar">
<?php if ( is_page('wp-login.php')) : ?>
<?php include(TEMPLATEPATH . '/sidebar-logreg.php'); ?>
<? else : ?>
<?php include(TEMPLATEPATH . '/sidebar.php'); ?>
<?php endif; ?>
</div>
Can anyone point out what I may be doing wrong?