I have created a custom page template in my child theme of Thematic and named it page-template-listingsite.php. It shows as an option for a template when I make a new page.
I have seen how a alternate stylesheet can be used for a specific page, whether it is by ID number, or page name, but can the stylesheet be used whenever the page-template-listingsite.php is used?
ThemeShaper Forums » Thematic
Different CSS for a custom page template
(5 posts)-
Posted 1 year ago #
-
The answer is yes.
For loading a different style sheet, reference http://programming.thematic4you.com/2010/01/how-to-use-a-different-layout-for-a-certain-page/
For the Conditional Tags to use, reference http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template
Now, as a follow up, how much are the styles really changing? With WordPress/Thematic, they do use body classes, so if you check in your body tag you will see
<body class="page page-id-11 page-template page-template-template-page-fullpage-php layout-2cr">So if you are needing minimal style changes, you could actually target the class of .page-template-template-page-fullpage-php (which is my full page template) and override the styles of other pages, this will be by far easier than adding another style sheet. Just depends on what you are trying to accomplish and how different the page is.
Posted 1 year ago # -
Thanks so much. That would be easier, but I can't get it to work. What am I doing wrong? Here is what I added to my style.css
#footer .page-template-template-page-listingsite-php { background:#000000; }It is at the bottom of the style sheet but the color of normal footer still shows on that page
The regular style sheet/page template is at
Teamwalsh.onlineaor.com
and the page I am trying to work with is at
http://teamwalsh.onlineaor.com/listings-2/8468-deerwood-drive-north-charleston-sc-29406/Posted 1 year ago # -
.page-template-template-page-listingsite-php #footer { background:#000000; }Is what you are looking for since the footer is inside the body tag. ;)
Posted 1 year ago # -
THANK YOU!!! I will get this all to make sense one day
Posted 1 year ago #
Topic Closed
This topic has been closed to new replies.