ThemeShaper Forums » Thematic


Select a specific template - not working

(6 posts)
  • Started 11 years ago by jrobben
  • Latest reply from jrobben
  • This topic is resolved
  1. I have been trying to make on the changes to a template that users will select for a particular type of post. but I can not get the an if is_page_template = to mytemplate.php to work.

    These pages will be made off and on so page id# or something similar will not work for this use.

    Posted 11 years ago #
  2. hi jrobben-
    I think you may be going about it in the wrong way. try something like: is_page_template('about.php')
    This may helpalso:


    Posted 11 years ago #
  3. sorry I should have posted the actual code here is function have ran to test for various pages. I commented out all but one testing for is_page_template
    I set this up as part of my trouble shooting.

    function test_code() {
    // echo "is_single: "; var_dump( is_single() );
    // echo "is_home: "; var_dump( is_home() );
    // echo"is_page: "; var_dump( is_page() );
    /*echo "is_page_template: "; var_dump( is_page_template() ); */
    /* echo "is_page_template('page-template-2col-page-php'): "; Var_dump( is_page_template() ); */
    echo "is_page_template('2col-page.php'): "; Var_dump( is_page_template() );
    add_action('thematic_belowheader', 'test_code');

    currently running on and resolving as true for any page, false for home, and posts, categories

    Posted 11 years ago #
  4. just so you know; for now, these are the changes to the template page that I want to make

    // from style.css (line 248) increase width from 560px
    #container {

    // style.css (line 347) to display:none or use function to remove
    #secondary {

    // reposition primary sidebar style.css and make postion fixed or relative to the top right corner of the container (line 335)
    #primary {

    // remove the comming attractions -
    // either display none or turn off function that creates it style.css (line 315)

    #above-primary {
    background:red none repeat scroll 0 0;
    margin:0 20px 10px 0;

    Posted 11 years ago #
  5. resolving as true for any page, false for home, and posts, categories

    That's beacause all pages use page templates. You need to specify which template.

    echo "is_page_template('2col-page.php'): "; Var_dump( is_page_template('2col-page.php') );

    Posted 11 years ago #
  6. Thanks, easy when you know how. lol

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.