Print different message on each post based on category type while excluding the latest post

Question

I have been struggling to find a better way to do this, I would like to print different messages on all posts based on the category type while excluding the lastest post in each category.

if ( in_category('category-1') ) { 
  echo '<p>This is an older blog post, you will find one on more recent data</p>';
} else if ( in_category('category-2') ) { 
  echo '<p>This is an older blog post, you will find one on more recent data</p>';
}

I hope someone could help me out.

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/print-different-message-on-each-post-based-on-category-type-while-excluding-the-latest-post/">

Print different message on each post based on category type while excluding the latest post</a>
0
, Etihw Freeman 2 months 0 Answers 47 views 0

Leave an answer