0

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 custom Author Info Box below every post. Here's the code at GIST.

The problem is that the author info box is also showing on a custom post type of single-professional.php. I do not want it there. Those pages provide a profile/description of each author. I only want the author info box to show on single posts (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 need to get rid of it completely from those wrong pages to avoid ranking issues with search engines (perception of cloaking).

Any assistance with what the correct PHP code needs to be to show the author info box only on single.php posts and not on single-professional.php posts would be greatly appreciated. Thanks.

1
  • Are they sharing the same content-single.php or similar in the get_template_part()?
    – Cedon
    Commented Mar 18, 2017 at 0:49

1 Answer 1

0

Replace line #3 with this if ( is_single() && isset( $post->post_author ) && 'post' == get_post_type() )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.