WordPress.org

Forums

Related Posts
[resolved] Control position of related posts in single post (8 posts)

  1. PhD2Be
    Member
    Posted 1 year ago #

    I would like to display my related posts below my social sharing buttons of my posts. See for example this page where the related posts appear just after the end of the content:

    http://www.luishestres.com/has-the-keystone-xl-fight-been-a-mistake/

    Which file(s) do I need to edit on WP to change the related posts placement? Is it a theme template, or plugin files themselves? Thanks!

    https://wordpress.org/plugins/related-posts/

  2. PetraP
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    thanks for reaching out - I'll gladly help! You will need to make some changes in one of the theme's files but in order to identify which one, I need to know which plugin exactly are you using to implement those "share this" links?

    Looking forward to your reply,
    Petra

  3. PhD2Be
    Member
    Posted 1 year ago #

    Hi Petra,

    I'm using Jetpack's sharing module for the social buttons (http://wordpress.org/plugins/jetpack/) and the theme is Fashionista by AThemes. Thanks!

  4. PetraP
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    thanks for getting back to me! Jetpack is a bit trickier to "hack" than some other plugins but I found this topic that should help you out:
    http://wordpress.org/support/topic/share-buttons-position-above-other-plugins

    Please let me know how it goes, I am eager to hear the results.

    Take care and have a nice day,
    Petra

  5. PhD2Be
    Member
    Posted 1 year ago #

    The link seems helpful but I'm still not sure in which template file I would insert the second part of the code (the <?php echo sharing_display(); ?> bit). I'm also not well-versed enough in PHP to know what to look for exactly. I've looked at content.php, content-single.php, and single.php but don't know which is the right one or where in the code to make the edit. I'd be happy to share code here from the right template if that will help. Thanks!

  6. PetraP
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    I have installed the Jetpack plugin and Fashionista theme. So, I think I have the solution for you (and please forget about that topic link I gave you before, and change everything back if you have changed anything):

    first go to your plugin settings, scroll to the bottom and un-tick the box next to "Auto Insert Related Posts" and click the 'Save' button. Then go to the tab 'Appearance'-'Editor', select your theme in the upper-right corner ("fashionistas" theme), and find the single.php file. In it, copy & paste the following code: <?php wp_related_posts()?> just below the <!-- .author-info --></div> code. Please chech this screenshot for easier navigation.

    Click the 'Update File' button, go to your blog post, refresh the site and let me know how it went! I'm eager to find out!

    All the best,
    Petra

  7. PhD2Be
    Member
    Posted 1 year ago #

    This worked! I'm thinking that maybe I want to display the related posts above the categories/tags box too (notice that I removed the author info so the related posts wouldn't get pushed down so much). Instead of editing the single.php file could I edit the content-single.php file and place your code above the entry footer code?

    Thanks for all you help with this and for the awesome plugin. Keep up the good work!

  8. PetraP
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    so first I had a bit of a problem getting the category and tags to show up there, where yours did. But then I noticed in the code, that you actually need a tag to show them there :). Soooo, I have finally managed to put our related posts above those catagories/tag by adding the wp_related_posts(); in the content-single.php file just below the

    if ( ! athemes_categorized_blog() ) {
    				// This blog only has 1 category so we just need to worry about tags in the meta text
    				if ( '' != $tag_list ) {
    					$meta_text = __( '<span class="tags-links"><i class="ico-tags"></i> %2$s</span>', 'athemes' );
    				}
    
    			} else {

    It should look something like this: a screenshot. Hope this helps!

    Take care and have a nice weekend,
    Petra

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Related Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic