• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems