Site logo

Archived topic

Give every h1-entry title an id?

1 reply · Started by Anonymous on January 15, 2016

Viewing posts 1–2 of 2

Hi Tom,

I was wondering if it's possible to give every entry title on my pages an id instead of the class "entry-title"?

Now it says: <h1 class="entry-title" itemprop="headline">Home</h1>.

I would like to give them all different background colors!

Thanks,

Julia

Hi Julia,

It's possible, but it would be difficult.

Instead, I would use the body class.

Each page is given a unique class with the page ID - you can see it by using your Inspect Element tool in your browser.

The <body> element should have a class like this: page-id-xx

"xx" being the ID of the page.

So you can target individual entry-title elements like this:

.page-id-xx .entry-title {
    /* CSS to make this one entry title different */
}

Let me know if you need more info :)

This archived topic is closed to new replies.