WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts by Zemanta
[resolved] Related posts on pages (3 posts)

  1. deck_sigma
    Member
    Posted 1 year ago #

    What's the trick for getting related posts to display on the main page?

    http://wordpress.org/extend/plugins/related-posts-by-zemanta/

  2. silvoslaf
    Member
    Plugin Author

    Posted 1 year ago #

    Hey!

    No special trick, just a few minutes of your time to follow the steps below. :)

    Go to your WordPress's Dashboard under the tab 'Appearance'-'Editor' and choose your theme in the upper right corner (usually it's called "Twenty Eleven" or "Twenty Twelve"). Now click on the 'content.php' file, which you can find on the right hand side of your screen. After that, search for the following code in the code editor:

    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>

    Now that you have found this, just add the following code line at the end of it:

    <?php wp_related_posts()?>

    So, to sum it up, the whole thing should look like this:

    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>
    		<?php wp_related_posts()?>

    Remember to click on the 'Update File' button when you're finished. Visit your blog, refresh the whole page and you should be able to see those related posts over there.

    Did it work? Need any further assistance or do you have any other questions? Let me know — I'll gladly help!

    Best,
    Silvo

  3. deck_sigma
    Member
    Posted 1 year ago #

    That worked awesome, thank you so much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic