ThemeShaper Forums » Thematic

[closed]

Select a specific template - not working

(6 posts)
  • Started 9 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 9 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:
    http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template

    -Gene

    Posted 9 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 www.cookingsalmon.net and resolving as true for any page, false for home, and posts, categories

    Posted 9 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 {
    width:700px;
    }

    // style.css (line 347) to display:none or use function to remove
    #secondary {
    float:left;
    width:200px;
    }

    // reposition primary sidebar style.css and make postion fixed or relative to the top right corner of the container (line 335)
    #primary {
    float:right;
    margin-right:20px;
    width:200px;
    }

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

    #above-primary {
    -moz-background-clip:border;
    -moz-background-inline-policy:continuous;
    -moz-background-origin:padding;
    background:red none repeat scroll 0 0;
    color:green;
    float:right;
    margin:0 20px 10px 0;
    padding:5px;
    width:400px;
    }

    Posted 9 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 9 years ago #
  6. Thanks, easy when you know how. lol

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.