How to Remove Author Info Box from custom post types
-
I’m not a php developer. I can handle html and css and my goal is to become proficient with php and javascript but right now I dabble with the latter two. In this case, I added some code to functions.php to create a customized Author Info Box below every post. Here’s the code at GIST.
The site involves an association of 19 people – all of whom will be writing blog articles – with only a couple of them (with limited WP knowledge) performing the task of actually posting the articles. So, it works out well that Author Info Box automatically pulls the author’s display_name into the info box at the end of each post (single.php).
The problem is that the info box is also showing on a custom post type of single-professional.php, which provides a profile/description of each author. I only want the author info box to show on single.php. I’ve temporarily used CSS (display:none) to keep it from displaying on the wrong pages but I need to come up with a better solution.
I’m looking for the appropriate code to show the info box below all blog articles (single.php) but NOT show it on custom post pages like single-professional.php because they are author profiles, not articles.
Here’s an example page from the site where the info box shows correctly (scroll down to the end of the article) and here’s an example page where I do NOT want it to show. (Again, it’s currently not showing because I’ve removed it with css; you can find it with a browser inspection tool. I need to get rid of it completely.)
Any assistance with what the correct code needs to be to show the author info box only on single.php and NOT single-professional.php would be greatly appreciated. Thanks.
- The topic ‘How to Remove Author Info Box from custom post types’ is closed to new replies.