WordPress.org

Ready to get started?Download WordPress

Forums

Custom Header, changing styles (3 posts)

  1. nelsonc
    Member
    Posted 1 year ago #

    not sure how to do this.

    I am using twenty twelve, and I would like to change the style of the header text. I can start to do what I would like in a child theme but what I really want is to use two different h tags in the header (or i guess a span?).

    eg:
    <h1>my </h1><h2>new </h2><h1>website</h1>

    <h1 class="site-title">
    <a href="http://abc.com/">my new website</a>
    </h1>

    I dont know how to get at the code, I dont know how to get to the "new" so that it specificly could be a different weight than the reast of the title.

    kind of like how the title works on this site:
    http://www.clarkrichardnelson.com/

    here is the site I am working on:
    http://adeepriver.com/wp_crn_site/

    I guess i could use a image, but I it just does not feel elegant.

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You'd probably be best off using a span tag around the middle section - don't use multiple h tags (you'll mess up your SEO a lot for one thing). So the rendered HTML would look something like this:

    <h1>clark<span class="richard">richard</span>nelson</h1>

    and you'd target the "richard" part using CSS with that class:

    h1 span.richard {
       styles go in here;
    }

    But because of how the current header.php is coded -- i.e. pulls the site title -- I don't think you can do what you want without hard coding the HTML. That may or may not be ideal, but it's an option.

  3. nelsonc
    Member
    Posted 1 year ago #

    Thank you,

    soved the problem, yes may not be ideal, and happier with that than a gif.
    now just have to remember that if i change the header or rather use this child on another blog.

Topic Closed

This topic has been closed to new replies.

About this Topic