There are certain posts on the website I’m developing, that don’t need the author(s) by-line. (such as press releases)
Is there any method, that allows me to remove the author (and co-authors) for certain posts?
There are certain posts on the website I’m developing, that don’t need the author(s) by-line. (such as press releases)
Is there any method, that allows me to remove the author (and co-authors) for certain posts?
You must be logged in to post a comment.
A quick fix would be to use WP’s body class and in your stylesheet target the element containing the autor name to hide it for the page(s) you want.
For example :
Update :
Another solution would be to use conditional tags in your templates, to print the author names only on wanted pages.
Thanks to mike23’s suggestion, I solved my problem with conditional tags.
Just insert the following in the author area of
single.php
,archive.php
and any other page template that displays an author.Using the above code, you can remove the author name on all posts tagged
press-releases
.All posts without the tag
press-releases
will retain their author name.