Support » Fixing WordPress » Custom single.php for wordpress pages such as profile.php

  • 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
    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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?

    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; ?>


    Can anyone point out what I may be doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom single.php for wordpress pages such as profile.php’ is closed to new replies.