WordPress.org

Forums

Share Buttons by AddToAny
Strip the page number from multi-page permalink when sharing (2 posts)

  1. NorthernBelleDiaries
    Member
    Posted 1 year ago #

    I haven't found the answer to my question.

    Is there a way to remove a certain page from being shared? For example, I have a 3-page post but when people share the post, the 3rd page is being shared on Pinterest and not the first.

    http://www.domain.com/sample-post/3 is being shared instead of
    http://www.domain.com/sample-post/

    I had to disable the plugin because of constant inquiries re: the beginning of this oil stain tutorial.

    I was using this php coding <?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?> in a Genesis hook that shows up in each post, so I cannot modify the shortcode because it would affect every post.

    How can I use this sharing plugin on all of my posts, but strip the numbered pages (parameters) on multi-page posts from being shared?

    Thanks so much!

    https://wordpress.org/plugins/add-to-any/

  2. micropat
    Member
    Plugin Author

    Posted 1 year ago #

    AddToAny's shortcode, and the PHP hardcoded method you're using should, point to the real permalink regardless of the page number.

    Double-check that you've placed that line of PHP code in the appropriate Genesis loop, which itself should, importantly, be within The Loop.

    A sign that you're outside The Loop is that, with AddToAny enabled, you see the following empty JavaScript properties when you 'view source' from your web browser:
    {title:'',url:''}

    Instead, the JavaScript properties should be filled in like:
    {title:'How to Remove Set In Oil Stains',url:'http://northernbellediaries.com/removing-set-in-oil-stains/'}

    For empty values, AddToAny falls back to using the current page, which is most likely why the post's page numbers are getting shared.

    Check with Genesis for where in The Loop to place AddToAny's PHP code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Share Buttons by AddToAny
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic