Change Size of P Tag on One Page Template

admin2025-06-05  5

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 6 years ago.

Improve this question

I have two blog types on my website (Blogs and Updates). I need to change the P tag font size in both page templates. These are the page templates that show a list of the posts/articles. Blogs page (category.php) shows 10 articles at a time, and Updates page (index.php) shows 10 articles at a time.

For the Blog page (category.php): I was able to change the font size on the category.php page template using

    body.category p {
    font-size: 20px !important;
    }

For the Updates page (index.php): The paragraph string that shows the article excerpt

    <?php the_excerpt(); ?>

is inside of a div that is styled by class a named ".entry"...if that makes any difference. I have tried several variations, but nothing has worked yet:

    .page-template-index .entry p {
    font-size: 16px !important;
    }

    body.index p {
    font-size: 16px !important;
    }

    entry.index p {
    font-size: 16px !important;
    }

Any help is greatly appreciated!

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 6 years ago.

Improve this question

I have two blog types on my website (Blogs and Updates). I need to change the P tag font size in both page templates. These are the page templates that show a list of the posts/articles. Blogs page (category.php) shows 10 articles at a time, and Updates page (index.php) shows 10 articles at a time.

For the Blog page (category.php): I was able to change the font size on the category.php page template using

    body.category p {
    font-size: 20px !important;
    }

For the Updates page (index.php): The paragraph string that shows the article excerpt

    <?php the_excerpt(); ?>

is inside of a div that is styled by class a named ".entry"...if that makes any difference. I have tried several variations, but nothing has worked yet:

    .page-template-index .entry p {
    font-size: 16px !important;
    }

    body.index p {
    font-size: 16px !important;
    }

    entry.index p {
    font-size: 16px !important;
    }

Any help is greatly appreciated!

Share Improve this question asked Dec 14, 2018 at 15:38 WebmanWebman 631 silver badge11 bronze badges 4
  • Can you provide a link? – RiddleMeThis Commented Dec 14, 2018 at 15:41
  • 2 Did you try .entry p? – rudtek Commented Dec 14, 2018 at 16:00
  • Holy cow lol.... .entry p worked! – Webman Commented Dec 14, 2018 at 16:12
  • I'm glad it worked. I've added as an answer. could you please mark it (green check to the left of the answer) – rudtek Commented Dec 14, 2018 at 16:50
Add a comment  | 

1 Answer 1

Reset to default 1

Entry is a class so when you're adding it to css you need to add a . in front. just try doing this:

.entry p {
font-size: 16px !important;
}

See if that works.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749099210a316354.html

最新回复(0)