Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Resolved] Auto displaying WPSP List at end of post

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Auto displaying WPSP List at end of post

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1457
    Sarah
    Participant

    Hi Tom, instead of installing a separate related posts plugin, I thought I’d create a list for each posts category I’ve created. But now, instead of having to look up and drop the relevant List shortcode at the end of each post, is it possible to add something to my Child Functions.php so any post automatically adds the relevant List for the single category it’s posted in at the end of the post? I hope that makes sense!

    Thanks for your help,
    Sarah :

    **UPDATE**
    I’ve just realised that you’ve included a Show Posts shortcode shortcut in the kitchen sink, so that makes things easier. Would still be interested if there’s a way of automating it though.

    • This topic was modified 3 years, 10 months ago by Sarah.
    #1460
    Tom
    Keymaster

    You could use something like GP Hooks (in GeneratePress) to add a list below the content of every post, however there’s not currently a way to tell the list to show posts only related to the post being viewed.

    This is something I’d like to get added in the future 🙂

    #2506
    Sarah
    Participant

    Hiya Tom, can you tell me what I’d need to put in the After Content hook so that it only displays the Show Post info on the single posts (blog posts). Not sure if there is something I can do with the shortcode and css? Or do I need to do something with Function? Also any idea when you may be updating pro to include related posts? I’m just going to set it to ‘order by: Random’ for now.

    Thanks,
    Sarah 🙂

    #2507
    Sarah
    Participant

    I’ve solved it – found something you answered in the GP Forums which has worked. I took the following advice to add the PHP code in the After Content section in GP Hooks

    ———-

    To make sure it only shows up on single posts, wrap it in this conditional:

    <?php if ( is_single() ) : ?>
    [SHORTCODE HERE]
    <?php endif; ?>

    Then make sure Execute PHP is checked.

    • This reply was modified 3 years, 3 months ago by Sarah.
    #2510
    Tom
    Keymaster

    Perfect – thanks for sharing the solution! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.