WordPress.org

Ready to get started?Download WordPress

Forums

Post title size. (22 posts)

  1. Jane Milburn
    Member
    Posted 1 year ago #

    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.

  2. 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.

  3. Jane Milburn
    Member
    Posted 1 year ago #

    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?

  4. Jane Milburn
    Member
    Posted 1 year ago #

    Am Ilooking in the wrong place?

  5. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    First make sure you have a valid Child Theme.
    http://codex.wordpress.org/Child_Themes#Example_of_a_basic_Child_Theme

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

  6. Jane Milburn
    Member
    Posted 1 year ago #

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

  7. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Why aren't you importing the styles over?
    http://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?

  8. Jane Milburn
    Member
    Posted 1 year ago #

    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?

  9. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    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.

  10. Jane Milburn
    Member
    Posted 1 year ago #

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

  11. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

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

  12. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    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.

  13. Jane Milburn
    Member
    Posted 1 year ago #

    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.

  14. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    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.

  15. Jane Milburn
    Member
    Posted 1 year ago #

    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?

  16. Jane Milburn
    Member
    Posted 1 year ago #

    Ok I will do that.

  17. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Yeah, it makes our lives much easier because we don't have to wade through hundreds of lines of code. There's much more chance of you receiving a solution.

  18. Jane Milburn
    Member
    Posted 1 year ago #

    It's very difficult knowing what to believe from online answers. I have learnt my lesson though and will only listen to experts on their subject like yourself and some moderators here.

  19. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    only listen to experts on their subject like yourself and some moderators here.

    Well... When I started out on forums, I used to make mistakes because I didn't know anything about Child Themes, or WordPress.
    We encourage everyone to post here, make mistakes and learn from them ;)

    I don't actually use WordPress myself so I'm probably a bigger novice than anyone I meet on forums.

  20. Jane Milburn
    Member
    Posted 1 year ago #

    lol, well you certainly helped me. Thank you very much. It's 2am here, so I will sort this tomorrow.

  21. Sorry, I made a mistake in my code. I'm missing a dot in front of entry-title

    .sticky .entry-title {
    font-size: 30px !important;
    }
  22. Jane Milburn
    Member
    Posted 1 year ago #

    Thank you so much, but in the end I changed things around completely and do not need to adjust the post title size. However, I probably will at some stage, so your help is much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic