WordPress.org

Ready to get started?Download WordPress

Forums

Cange titel color each page (8 posts)

  1. yaya85
    Member
    Posted 2 years ago #

    Hello WordPress users,

    My name is Jason and I'm a newbie on the forum, but works now about 6 month with the great application WordPress.

    I would to know if some body can help me with changing color title's of each page on a sub-header.

    the main problem is that the css code for every page is the same like this.

    #sub-header-content h1 {
    color: #FFFFFF;
    float: left;
    font-family: DancingScriptOTRegular;
    font-size: 36pt;
    font-weight: normal;
    line-height: 39pt;
    padding: 10px 0;

    can some body tell me how to set different color each page?

    Many Thanks!

    Jason

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    does your theme use body_class() in the body tag in header.php?

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

  3. Tarsem Singh
    Member
    Posted 2 years ago #

    Please edit your Theme e.g. wp-content->themes->your_current_theme->page.php

    you can find here

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

    OR

    <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>

    Just add a class like <h1 class="page_title"> or <h2 class="page_title"> and assign a page_title class in your style.css

    Like

    .page_title{
     color:#0000ff;
    }

    You can find your CSS file by..

    wp-content->themes->your_current_theme->style.css

  4. yaya85
    Member
    Posted 2 years ago #

    Thanks guys for your response!

    the page.php is like this:

    [code moderated - use the pastebin for any code over the forum limit of 10 lines]

    So where in te row i need to put this code <h1 class="page_title"> and is the name ''page_title'' an example or a (hard) code?

    Many Thanks!

  5. Tarsem Singh
    Member
    Posted 2 years ago #

    ''page_title'' is an example. you can choose you name/class

  6. yaya85
    Member
    Posted 2 years ago #

    Hi Tarsem singh,

    Do i need to put this code <h1 class="page_title"> after like example this code:

    <h1>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h1><h1 class="page_title">

    (Other question do you have also some paid services? because I have some other projects)

    Many thanks!

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. The above code is now irretrievably mangled.]

  7. Tarsem Singh
    Member
    Posted 2 years ago #

    No No... wordpress themes already using this type of code for Title. Please Paste me link of your website where you want to changes.

  8. drog1998
    Member
    Posted 1 year ago #

    Hi there,

    i'm, trying to achieve the same thing as yaya85 and assign a different color to each H1 heading on each page but i'm having a little trouble understanding how you do it.

    I'm also looking to place a different colour logo on each page too.

    Here's my code from page.php of my template.

    http://pastebin.com/Vbhe6RtQ

    Hopefully you can help

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic