Forums

Random Post not showing comments (3 posts)

  1. fruitbat2000
    Member
    Posted 9 months ago #

    Hi there, I've looked through a lot of forum posts, but I can't see any that match the problem I'm having - I wonder if someone out there might be able to help...

    I have a link on the front page of the site I'm building that links through to a random article (which loads on a new page using a custom template). The code I'm using to pull the random post is as follows:

    code here

    It's basically a regular loop, with a query_posts function at the beginning.

    My problem is that although the random posts load fine, the comments for those posts don't load at all. I know I'm probably missing something obvious, but I'm pretty new at all this and I'm not sure what I'm doing wrong!

    Edit: replaced code with pastebin URL :)

  2. equalmark
    Member
    Posted 9 months ago #

    http://codex.wordpress.org/Function_Reference/comments_template

    Not the description in that this will only work for single post or page displays. Therefore if your URL is not the page or post that is being displayed randomly then it won't work.

  3. fruitbat2000
    Member
    Posted 9 months ago #

    Oh ok, thanks Equalmark, I think I see what you mean. Is there a way around this or am I best off leaving it as it is?

Reply

You must log in to post.

About this Topic