Support » Plugin: AddToAny Share Buttons » Add independent share buttons to posts in archive page

  • Resolved Bohdan Shila

    (@garpion)


    Hello!

    How can I add share buttons to each post in a loop and make them share that post and not the entire page?

    I’ve tried to put “add to any” php function inside the loop but no success.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author micropat

    (@micropat)

    Hi Bohdan, are you using the right AddToAny function, and is the loop working?

    This displays share buttons that share the current post when placed within the WordPress loop:

    <?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>

    You can test the AddToAny template tag in the Twenty Seventeen theme’s archive.php file or the content files in its template-parts directory.

    Thread Starter Bohdan Shila

    (@garpion)

    ¡Hello!

    Yes, I actually used this function and it works well for Twitter but when I try to share the post in Facebook, it shares the home page and when I try it with +Google it says “invalid URL”.

    Plugin Author micropat

    (@micropat)

    Check the meta tags on your pages and see the FAQ on Facebook sharing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add independent share buttons to posts in archive page’ is closed to new replies.