ThemeShaper Forums » Thematic

[closed]

styling individual pages

(8 posts)
  • Started 9 years ago by mopani
  • Latest reply from Val
  • This topic is not resolved
  1. mopani
    Member

    I'm working with thematic, using a child theme. I have a stylesheet and a functions.php in my child folder.

    I have a lot of pages and I want to style each one individually. I can work with CSS reasonably well but I'm not sure about where the stylesheet for each page would go and what adjustments I have to make to any of the other php files for example.

    Any help or pointers to previous posts would be most appreciated. Thanks in anticipation

    Posted 9 years ago #
  2. Mopani,

    You´ll create all your new css code, for all your pages, into the default.css
    wp-content/themes/thematic/default.css

    Have a Good Jobs,

    oscar

    Posted 9 years ago #
  3. Hi,

    could you please give us some more details?!

    Do you want to change only a few things like colors or so?

    Or .. do want to implement a completely different style / layout?

    Chris

    Posted 9 years ago #
  4. mopani
    Member

    My pages will be static documents, as you'd expect, with content about various projects, each with different subject matter. I want to have the same header and footer (no sidebar) but the option for completely different layouts for each page.

    So my guess is that I can have a different stylesheet for each page which over-rides the defaults. I can handle the styling in slow time but have no idea how to set up the stylesheets, where they go and what code I need to change elsewhere.

    Posted 9 years ago #
  5. Hi,

    take a look at this post: How to use a different layout for a certain page?.

    Chris

    Posted 9 years ago #
  6. mopani
    Member

    Tx Chris - I'll work with this and see if I can get the reults I want.

    james

    Posted 9 years ago #
  7. HI,

    Where I put sets about my installation at the code below:

    01.// filter thematic_create_stylesheet to implement your own stylesheets
    02.function my_stylesheet($content) {
    03. // We test if we're on home or on your frontpage
    04. if (is_home() || is_front_page()) {
    05. // yes, we are .. now let's load the 3c-fixed layout
    06. $content = "\t";
    07. $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    08. $content .= get_bloginfo('stylesheet_directory') . "/style-home.css";
    09. $content .= "\" />";
    10. $content .= "\n\n";
    11. } else {
    12. // we are not .. let's load the 2c-r-fixed layout
    13. $content = "\t";
    14. $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    15. $content .= get_bloginfo('stylesheet_directory') . "/style.css";
    16. $content .= "\" />";
    17. $content .= "\n\n";
    18. }
    19. // $content will be handed back to thematic_create_stylesheet
    20. return $content;
    21.}
    22.// connect the filter to thematic_create_stylesheet
    23.add_filter ('thematic_create_stylesheet', 'my_stylesheet');

    Already made everything that said in the Chris post.

    Posted 9 years ago #
  8. Chris and Ian,

    Hello and Thank you (if I'd found a "Welcome/Introduce Yourself" thread, I would've done so there !).

    I read "A Technical Matter: Parallel Style Sheet Downloading" on the Modular CSS in WordPress Child Themes page. Then read Chris' "How to use a different layout for a certain page?"

    Is there anything "wrong" with conditionally calling different stylesheets like this? Note that the child theme style.css does not do any @import (that's been removed).

    // Change the page layout if this is the home page
    // Action: gettherightstyle_css

    function gettherightstyle_css() {
    // Define the action to take if home.php is loaded: get styles from my child theme:
    if (is_home())
    {
    ?>
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/reset.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/library/styles/homepage_style.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/library/layouts/1c-m-fixed.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/plugins.css" />
    <?php }

    else // for all other pages - go get the thematic styles:
    {
    ?>
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/reset.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/typography.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/images.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/layouts/2c-r-fixed.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/default.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/images.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/library/styles/plugins.css" />
    <?php } //end the conditional action
    } // Close the function

    // Add our new action to the appropriate place in the theme like so:
    add_action('wp_head', 'gettherightstyle_css');

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.