We're merging with GenerateBlocks! Learn more here.

[Resolved] Add Social to post pages only

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Add Social to post pages only

Tagged: 

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #24148
    Tom
    Keymaster

    Absolutely, you can do this:

    add_action( 'wpsp_after_content', function( $settings ) {
        if ( 123 === (int) $settings['list_id'] ) {
            ?>
                Your code in here.
            <?php
        }
    } );

    Just be sure to update 123 to the ID of the list you’re targeting 🙂

    #24169
    Jennifer
    Participant

    Thank you so much for your time and help!! Unfortunately it is not doing what I like.

    Would you consider adding your social media to the individual post pages by providing a code we can add to the hook element in Generatepress?

    My goal was for them to see the heart likes located on the WP Show Post. They click on the post and then if they decide to like it as well then the heart like button would be located on the post page.

    Again thank you so much Tom 🙂

    Jennifer

    #24276
    Tom
    Keymaster

    As they’re built right now, it wouldn’t be an easy task, unfortunately. A lot of the code relies on the presence of the shortcode itself on the page.

    One “hack” would be to load a hidden list of a single post with these options enabled on the page, but this means the post would have an extra query unnecessarily, which would be a shame from a performance perspective. You could try it and check the performance before and after to see if it’s worth it.

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.