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

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Custom Comment Header Title For Each Category

You can change the standard ‘Leave a Reply’ or ‘Speak Your Mind’ text displayed before every comment form.

This code enables you to customize each comment reply title for posts in different categories.

Here’s the PHP code (that works in any theme) which you need to copy from the the view raw link in the Gist and paste at the end of your child themes functions.php file.

Simply add your category i.d or category slug within the brackets of the conditional tags then rinse and repeat to add more categories.

Custom Comment Header Title

Code Efficiency

The way this code is written provides the most efficient and fastest way for the PHP processor on your server to parse this code.

There are other ways to write conditional tags with else if and elseif statements, however this is both the easiest and best method based on testing according to feedback on php.net.

Why hack core template file code when you can use filters in your child themes functions file.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.