• Resolved jakedold

    (@jakedold)


    I am trying to use a short code to display posts only by the currently logged in user. I saw a thread on here from about 6 months ago that said to use the following short code [display-posts author=”current”], but for some reason that is not working. I thought maybe there was a problem with the plugin, but I can make other short codes work like [display-posts author=”[email protected]”].

    Do I have anything wrong that is causing this issue?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Hmm, it’s hard to say what’s causing that issue.

    Since you say normal author queries work but the “current” one doesn’t, that leads me to think this is a caching issue. I recommend speaking with your host to ensure logged-in users aren’t getting a cached copy of the page.

    You can share with them this code that checks if the current user is logged in, and if so uses that user for the author.

    My guess is the page is generated once (by a non-logged-in user) with no results, cached, then that same one is served up to the logged in users.

    I hope that helps

    I’m not sure if it is causing the problem, but you are using instead of ". When I tried using ” it didn’t work for me.

    • This reply was modified 5 years, 9 months ago by ztfreak.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show posts by current user’ is closed to new replies.