Forums

[Plugin: Add to Any: Share/Bookmark/Email Button] Category Page Bookmarking (2 posts)

  1. M.K.
    Member
    Posted 2 years ago #

    Hi there,

    I put the code for the button on the sidebars of my theme. My website is designed so that category pages have the most weight and interesting content. I want users to be able to share category pages. But the button doesn't seem to recognize the URL on which it is appearing. Instead, it seems to be picking and favoring one of the posts on the category page.

    Any way to get it to just bookmark the URL on which it appears?

    Thanks,

    Mohammed

  2. M.K.
    Member
    Posted 2 years ago #

    I hacked the plugin to get this functionality.

    When I call the plugin from the sidebar, I pass arguments like this

    if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') )
    {
       $linkurl_enc = (!empty($_SERVER['HTTPS'])) ? urlencode("https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']) : urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
       $linkname_enc = urlencode(wp_title('»', false, 'right') .  get_bloginfo('name'));
    
       $args = array('linkurl_enc' => $linkurl_enc, 'linkname_enc' => $linkname_enc);
       ADDTOANY_SHARE_SAVE_BUTTON($args);
    }

    Then in the core of the plugin, in add-to-any.php, I modified lines 89-92 to make them look like this

    extract(A2A_SHARE_SAVE_link_vars()); // linkname_enc, etc.
    
    if( $args )
        extract( $args ); // output_later, html_wrap_open, html_wrap_close

    When the author updates this plugin, the hack in add-to-any.php will be overwritten, though.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags