Title: Related Posts didn&#8217;t show using shortcode
Last modified: March 27, 2019

---

# Related Posts didn’t show using shortcode

 *  Resolved [dadaogbegun](https://wordpress.org/support/users/dadaogbegun/)
 * (@dadaogbegun)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/related-posts-didnt-show-using-shortcode/)
 * My sincere appreciation goes to the author of this beautiful plugin. Nice project
   and tremendous reviews.
 * Out of plugins out there that could do similar thing I chose this plugin obviously
   because of its simplicity and reviews.
 * I think I must’ve been doing something silly for not being able to get it to 
   work for me.
 * WHAT I HAVE DONE:
 * 1. Installed the plugin, but there was no dashboard to manage settings.
    2. Used
   the basic shortcode `<?php echo do_shortcode('[related_posts_by_tax]'); ?>` on
   my content.php template file.
 * RESULT:
 * 1. Related posts didn’t show/display on my post page.
    2. No other indication
   that it worked.
 * QUESTIONS:
 * 1. Do I need to add maybe a block of codes to my function.php template, or any
   other thing else?
    2. Will the plugin not work if there is no related post to
   display?
 * Thanks very much.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [dadaogbegun](https://wordpress.org/support/users/dadaogbegun/)
 * (@dadaogbegun)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/related-posts-didnt-show-using-shortcode/#post-11362109)
 * MYSTERY DEBUNKED
 * How I solved the mystery:
 * 1. I created a duplicated of my WordPress, just preferred it that way.
    2. Populated
   the test WordPress with themeunittestdata.wordpress.xml. 3. Related Posts showed
   as expected.
 * Findings:
 * The plugin: Related Posts by Taxonomy won’t display if there’s related post.
 * Enjoy!
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/related-posts-didnt-show-using-shortcode/#post-11363129)
 * Hello dadaogbegun
 * Yes, it only shows if there are related posts. I’m glad you’ve got it solved 
   🙂
 * You can show a “No related posts found” message (if you want) by adding this 
   to your (child) theme’s functions.php file.
 *     ```
       // this will display the shortcode even if no results were found
       add_filter( 'related_posts_by_taxonomy_shortcode_hide_empty', '__return_false' );
       ```
   
 * btw:
    consider creating a [child theme](https://developer.wordpress.org/themes/advanced-topics/child-themes/)
   instead of editing your theme directly – if you upgrade the theme all your modifications
   will be lost.
    -  This reply was modified 7 years, 2 months ago by [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/).
 *  Thread Starter [dadaogbegun](https://wordpress.org/support/users/dadaogbegun/)
 * (@dadaogbegun)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/related-posts-didnt-show-using-shortcode/#post-11363284)
 * Thanks very much for your support. I can’t thank you enough.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Related Posts didn’t show using shortcode’ is closed to new replies.

 * ![](https://ps.w.org/related-posts-by-taxonomy/assets/icon.svg?rev=1115231)
 * [Related Posts by Taxonomy](https://wordpress.org/plugins/related-posts-by-taxonomy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/related-posts-by-taxonomy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/related-posts-by-taxonomy/)
 * [Active Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/)

## Tags

 * [not showing](https://wordpress.org/support/topic-tag/not-showing/)
 * [not working](https://wordpress.org/support/topic-tag/not-working/)
 * [won't show](https://wordpress.org/support/topic-tag/wont-show/)
 * [wont display](https://wordpress.org/support/topic-tag/wont-display/)

 * 3 replies
 * 2 participants
 * Last reply from: [dadaogbegun](https://wordpress.org/support/users/dadaogbegun/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/related-posts-didnt-show-using-shortcode/#post-11363284)
 * Status: resolved