WordPress.org

Forums

How to show relevant posts below main post? (6 posts)

  1. Emil_d08
    Member
    Posted 2 years ago #

    Hello,

    I want to make relevant posts to appear below the main post not on a sidebar. How can i do this? What code i have to use?

    Thanks!

  2. noahjonah
    Member
    Posted 2 years ago #

  3. Emil_d08
    Member
    Posted 2 years ago #

    The plugin is good but i want to display all the content of the related post not just the title. I want to make the inner pages to look like a homepage that shows, for example, 9 posts. But the posts under the main post to be related.

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

    consider to code a secondary loop in single.php, below the main loop, to show those 'relevant' posts;

    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/Class_Reference/WP_Query

    you will need to define your criteria for 'relevant' in terms of tags, categories, or so...

  5. Emil_d08
    Member
    Posted 2 years ago #

    Thanks, this is helpful information.

    I have another question. Is it possible to add a code that will perform a search on page load and will list the results under the main post. I mean when a inner page is loaded the script will take the post title and perform a search for relevant posts and list them under the main post.

    Is that possible?

    Thanks!

  6. alchymyth
    Forum Moderator
    Posted 2 years ago #

    I haven't tried it myself, but using the 'search' parameter in the query together with a list of keywords should work:
    http://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.