Forums

Changing header font/margin (6 posts)

  1. michaelfterry
    Member
    Posted 4 weeks ago #

    My website is <www.ugawaterpolo.com>

    My front page is a static page, and all of my other posts publish on another page I created called "Recent News." I created a page.php because I wanted the date/publish information to be visible on posts, but not on pages.

    I want to change the font size/style/margin for the pages, specifically the static front page, but not for the "news posts."

    I can't figure out how to go about doing this. Any help will be greatly appreciated!

    Michael

  2. esmi
    Member
    Posted 4 weeks ago #

    Right now, it's not possible to style your pages different to your posts as they both use identical classes. You'd need to add a unique class, or id, to the content area in your page template first and then style your page text content using that class/id.

  3. michaelfterry
    Member
    Posted 4 weeks ago #

    Could I just copy the current "class/id information" and rename it, then change the page text to that style?

  4. esmi
    Member
    Posted 4 weeks ago #

    The best way to do it would be to change class="post" in page.php to something like:

    class="page<?php if( is_front_page()) echo ' home';?>"

    As far as I can tell, the .post class isn't being used by the theme's stylesheet, so there's nothing you need to replicate at this point but you should then be able to use something like:

    .page {font-size:1.1em;}

    to increase the font size on Pages only. The .home class should also let you style the home page text content independently as well.

  5. michaelfterry
    Member
    Posted 4 weeks ago #

    Where should I change this...on page.php??

    Michael

  6. esmi
    Member
    Posted 4 weeks ago #

    Yes - see above.

Reply

You must log in to post.

About this Topic