• Hello, I want to change the size of post title. I have managed to do so by adding:-
    .entry-title {
    font-size: 30px !important;
    }
    to the bottom of my Twenty Eleven child theme, css.
    However this changes the size of all post titles. I only want the first post (sticky) to have large text/font size and the other post titles to be smaller.
    roymilburn.com

    I appreciate there are loads of posts here and information online but, I can not find the exact answer.
    Thank you.

Viewing 15 replies - 1 through 15 (of 21 total)
  • If you look at the HTML source code you’ll see that your sticky post has a class of sticky. So you can use:

    .sticky entry-title {
    font-size: 30px !important;
    }

    instead and that will make only that title bigger.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Hello, thank you so much but after adding the code to css, nothing changed. I reduced the px down and there was a change, so the code seems to change the font size but still on all post titles?

    Thread Starter Jane Milburn

    (@jane-milburn)

    Am Ilooking in the wrong place?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    First make sure you have a valid Child Theme.
    https://codex.www.ads-software.com/Child_Themes#Example_of_a_basic_Child_Theme

    Look at step 3.
    You need to import the styles over.

    Thread Starter Jane Milburn

    (@jane-milburn)

    I double checked and I do have a valid child theme.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Why aren’t you importing the styles over?
    https://www.roymilburn.com/wp-content/themes/twentyelevennew/style.css

    Edit: Oh you are, but why have you got that massive stylesheet? What’s going on?

    Thread Starter Jane Milburn

    (@jane-milburn)

    I am not sure what you mean, sorry. Oh, I think you mean there is so much in it. When I first got the child theme up and running, I was advised to copy and paste the parent style.css into it to make changes to rather than keep adding code, apparently saving time? I am a complete novice but thanks to this forum, I am gradually learning. So please excuse me if I’ve messed up big time?! In regards to importing themes over, I thought I had?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I was advised to copy and paste the parent style.css into it to make changes to rather than keep adding code, apparently saving time?

    Sorry, you have been misled.

    You’re using a browser developer tool, like Firebug, right? That exposes the CSS for you and then you write new CSS to override what has been exposed in the developer tool.

    You shouldn’t be editing the theme’s originating styles, they shouldn’t even be in your Child Theme.

    Keeping the original styles in your Child Theme means:
    – You have a hard time debugging CSS; it’s harder to differentiate between CSS you’ve made and CSS that originally resides in the theme.
    – You’re duplicating code.
    – There’s more chance for your styles not to work, because of the duplication of code in combination with CSS specificity.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Thank you. I am abit lost. Should I start afresh with a clean css?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’ve noticed I’m being particularly harsh tonight, don’t take this personally if you are.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Should I start afresh with a clean css?

    I don’t know, it depends on how much modifications you’ve made to your Child Theme’s stylesheet. I don’t want you to undo all your hard work.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Yes, I use Firebug. So I’m thinking delete the parent css and just add changes. Luckily I know what changes I made and code I added so if you agree I start afresh, it will not be difficult.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Luckily I know what changes I made and code I added so if you agree I start afresh, it will not be difficult.

    By starting afresh, I just mean deleting all the code underneath your @import line in the CSS. You leave your CSS modifications though.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Once I have done that, is there an answer to my problem with making my first post title font larger than all other post titles?

    Thread Starter Jane Milburn

    (@jane-milburn)

    Ok I will do that.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Post title size.’ is closed to new replies.