Group Admins

  • Profile picture of Sallie Goetsch

Themes

Public Group active 10 months, 2 weeks ago ago

Here’s where we talk about themes–links to your favorites, questions about using them, tips on building them.

Can you style a template page differently from the main site pages? (5 posts)

  • Profile picture of said 1 year, 6 months ago:

    I’m exploring templates and wanting to create different size content, header, and sidebar areas for particular pages. Would I put an include statement in the particular page.php file for a corresponding CSS file? Or would I style each page in it’s template file? Or am I trying to do the impossible? Been searching the codex and web for answers, but not finding anything on this. Am I overlooking the obvious?

  • Profile picture of said 1 year, 6 months ago:

    Ok. I figured that out at least partially. i was able to change the content width to the full page width by creating a new content ID statement in the Buddypress child theme style sheet. (Is that what you call it, a “statement” or is it a rule or some other name?) Something weird happened in the process though. The page title increased in size! Wonder what that’s about? Back to the drawing board.

  • Profile picture of said 1 year, 6 months ago:

    Hi Bruce,
    One thing that we do a lot is to use create a new page template for the new page you want and use the body class assigned to that page template body tag to isolate out style that are unique to that template.

    Just make sure the template tag body_class is included in your header.php template:

    http://codex.wordpress.org/Template_Tags/body_class

    So now I can write CSS exceptions for that page template such as this example for my new page template called page-academy.php:

    .page-template-page-academy-php h2{
    padding: 5px;
    }

    Good luck!

  • Profile picture of Sallie Goetsch Sallie Goetsch said 1 year, 6 months ago:

    I’m just starting to explore the possibilities of this, but apparently, if you wanted to, you could make each post category and each page look different using body_class and post_class. Separate page templates are for dramatic differences like leaving out sidebars altogether. That page title increase you had, Bruce, was probably the result of a body_class styling in the CSS, that said if the H2 was part of a page template, it should be X size, but otherwise Y size. You need to create a new CSS class for the new page with the same size attributes as the original. (I’m not explaining this well, don’t have the book next to me and am not practiced with it.)

  • Profile picture of Diana Thompson Diana Thompson said 10 months, 2 weeks ago:

    Another means y’all might consider is adding conditional tags to your standard template(s). http://codex.wordpress.org/Conditional_Tags. For instance, with “if (is_category())” you can add code for only a specific category or categories. Same deal for “if (is_page())” and a specific page or pages.

Stop SOPA