Re: Add custom text to specific category posts :: Reply by Joern

von Joern am 2. Mrz. 2010 | Keine Kommentare

If you use just one single.php for all singles and you want to display something on a single view only in one category, use the condition ‚in_category()‘, this tests if the current post is assigned to any of the specified categories.

Anywhere in single.php you can add this:

<?php if ( in_category( 'blogs' )) { ?>
here your code or explanation
<?php } ?>

try this code just as it is in single.php and look if you find "here your code or explanation" on your blogs category single page, if it works think about what to put in there
more about in_category here:

http://codex.wordpress.org/Function_Ref … n_category
btw: you had problems to post – I found your posts in the spam filter, too many links in there …
you find me on Google+, Twitter and Facebook

(von: Joern)

Hier noch 2 weitere Ergebnisse dieses Threads:

Add custom text to specific category posts

2. Mrz. 2010 (von: drwhom)

I think I've seen this elsewhere before but I want to add a block of text to every post that falls in our "blog" category (http://www.iamstaggered.com/category/blogs) explaining how to follow/subscribe to a particular writer if readers want to. Is there…

Re: Add custom text to specific category posts :: Reply by drwhom

8. Mrz. 2010 (von: drwhom)

Thanks ever so much again Joern! Weiterlesen →


Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: