Add Text to Single Posts In Specific Category or When On A Category Archive

There’s different ways you can code a custom function to display text on single posts in specific categories as well as on the same category archive page.

Note: All custom functions should be pasted at the end of your functions file, preferably in a child themes functions.php file. The following examples use the loop_start hook which works in any theme and the web-design category slug which you can swap out with your own category slug or category I.D.

Here’s 4 different methods:

1st Method

2nd Method

3rd Method

4th Method

This method creates a new widget area which you can populate with a text widget.

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.