[Resolved] How to change all post body fonts at once?

Home Forums Support How to change all post body fonts at once?

  • This topic has 13 replies, 3 voices, and was last updated 1 year ago by David.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #958211
    Ravi Dixit

    I was using different font when started my blog but now I am using another as I changed the theme to GeneratePress.

    So, my new post having different font and old are having different. Some having a different font and some having the same font but different font size.

    How can I make all post having the same font and font size, I don’t want to change the font of heading instead just want to change the font of paragraphs.

    #958482
    Leo
    Staff
    Customer Support

    Hi there,

    The post body font simply inherits the settings under Typography > Body.

    If there are certain paragraphs that don’t work, it’s likely that there are extra CSS or HTML inline style added that needs to be removed.

    If this is not clear, can you guide me to a post and section where I can see the issue?

    Let me know 🙂

    #958568
    Ravi Dixit

    The typography in the customize section is already set as I want for all the post.

    But when I was not using GeneratePress in my initial days, I used to TinyMCE plugin to customize font and font size for each post.

    Is there any CSS I can use…

    #958570
    Leo
    Staff
    Customer Support

    That depends.

    Can you guide me to a post and section where I can see the issue?

    #960133
    Ravi Dixit

    Here is the example of the post having different font https://www.staymeonline.com/tricks-you-should-know-for-affiliate-marketing/

    #960377
    Leo
    Staff
    Customer Support

    It’s added as HTML inline style so it’s not possible to overwrite using CSS unfortunately:
    https://www.screencast.com/t/xEWfRVKf

    You will need to manually remove that.

    #960521
    Ravi Dixit

    Okay, thanks for the help…

    #960526
    Leo
    Staff
    Customer Support
    #1014980
    Ravi Dixit

    Hello, LEO!

    As you know, some post has custom inline HTML added…

    How can I change all post font to make same at once?

    #1015120
    David
    Staff
    Customer Support

    Hi there,

    the only way to overwrite inline styles is by the use of important eg.

    span {
        font-size: 20px !important;
    }

    You would need to target any and all elements that use inline styles in this way.

    #1015153
    Ravi Dixit

    Thanks, David!

    It is hard for me to understand, Can I make it simple?

    #1015160
    David
    Staff
    Customer Support

    When adding styles using Tiny MCE it wraps the content in a span tag where the inline styles are added so this:

    <h2>A title</h2>
    <p>body text</p>

    becomes:

    <h2><span style="font-family: georgia, palatino, serif; font-size: 18pt;">A title</span></h2>
    <p><span style="font-size: 14pt; font-family: georgia, palatino, serif;">body text</span></p>

    So you have to target each of those Elements eg. p span, h2 span and override the inline CSS using !important.

    e.g Changing all of those spans font-family:

    p span, h2 span, h3 span, h4 span {
        font-family: "Alegreya Sans" !important;
    }

    Then you will need to set there font sizes individually eg.

    p span {
        font-size: 24px !important; 
    }
    #1015278
    Ravi Dixit

    Understood!

    But I don’t want to change using CSS, Because It will create the same issue in future.

    Is there any way I can remove all those TinyMCE custom HTML?

    #1015282
    David
    Staff
    Customer Support

    You would have to search and replace them in your SQL Database. Not something within our scope.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.