• Resolved Anonymous User 12115853

    (@anonymized-12115853)


    Hi,

    Can I use shortcode to specify Post ID to be shared, instead of URL? (I read Sassy shortcode docs)

    Example of use:
    https://backlinko.com/blog

    On Archive type of pages, post ID is more specific for each single post, whereas URL is not specific for single post in Archive pages.

    Thank you for the great plugin.

    Dao

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Anonymous User 12115853

    (@anonymized-12115853)

    Well, I found it doesn’t work to place Post ID shortcode inside another shortcode.

    Any idea that I can achieve this results?
    https://backlinko.com/blog

    If you have answer or not, all is fine for me though:)

    Plugin Author Heateor Support

    (@heateor)

    Hi Dao,

    You can get the url from the post ID and pass that in the shortcode. Something like following:
    <?php echo do_shortcode( '[Sassy_Social_Share url="' . get_permalink( $post_id ) . '"]' ); ?>

    Thread Starter Anonymous User 12115853

    (@anonymized-12115853)

    Hi Heateor,

    Thanks so much for helping.

    I use Genesis, with its Simple Edits plugin.

    I pasted your full code in Entry Meta (below content) field, and Sassy button is not even showed up…

    Switched to regular Sassy shortcode, it showed up.

    Thread Starter Anonymous User 12115853

    (@anonymized-12115853)

    Ideally I hope to paste in one line of code in “Entry Meta (below content)” field, and on blog listing page, when I click different buttons on the list, they will share each single post’s URL, instead of blog listing page’s URL (happening now)

    I don’t know if this is possible…

    Plugin Author Heateor Support

    (@heateor)

    The code posted above is for use in PHP template. It won’t work if you place it in theme’s options or meta options. If you cannot use shortcode in PHP template, you don’t have any other option.

    Thread Starter Anonymous User 12115853

    (@anonymized-12115853)

    It works! Made a donation to you. Keep up the good work.

    I installed Genesis Simple Hooks and checked Execute PHP & shortcode, and your code works:)

    Plugin Author Heateor Support

    (@heateor)

    You’re welcome. Thanks for the donation 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Specify Post ID to be shared, instead of URL?’ is closed to new replies.