WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddToAny
[Plugin: AddToAny: Share/Bookmark/Email Button] Custom standalone imgs + urls (1 post)

  1. Wroth
    Member
    Posted 3 years ago #

    I want to have post to twitter and Share [not Like] on facebook through two standalone buttons using custom imgs for the buttons. I have these working fine on the post's pages, but would like to use these buttons on other pages as well.

    I want to share from within a lightbox pop-up on archive pages that have nothing to do with the link I want to share, so need to pass the the_permalink and the_title of the post the buttons belong to these custom standalone buttons instead of the page the buttons are located on.

    To top it off, I will have up to eight different sets of these buttons hidden together on a page at once waiting to popped-up individually, so I need to be sure that each button returns the right link.

    I have not found a way to do this for standalone links with the custom images? Any ideas?

    I saw the function for the plugin that calls standalone images with specific urls,

    <?php
    if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) {
        echo '<div class="a2a_kit addtoany_list">';
        ADDTOANY_SHARE_SAVE_ICONS( array(
            "linkname" => "Example Page", "linkurl" => "http://example.com/page.html"
        ));
        echo '</div>';
    } ?>

    but that does not allow me to use custom images for the standalone buttons? Is there a way to define what imgs are used?

    I could try something like http://www.addtoany.com/buttons/customize/multiple_buttons_different_pages , but need to define a2a_button_twitter & a2a_button_facebook instead of a2a_dd. Standalones, not menus. Is there a way to do that? The code I have right now, which is not working at all because I am not calling a2a_dd, looks like

    <div class="a2a_kit">
    
    	<a class="a2a_button_twitter twitterbubble">
    		<img src="<?php bloginfo('stylesheet_directory'); ?>/img/slate-twitter.png" />
    	</a>
    
    <script type="text/javascript">
    	a2a_config.linkname = '<?php the_title(); ?>';
    	a2a_config.linkurl = '<?php the_permalink(); ?>';
    	a2a_config.templates = {twitter: "Check out ${title} ${link} by @snowmask"};
    </script>
    <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>
    
    	<a class="a2a_button_facebook facebookbubble">
    		<img src="<?php bloginfo('stylesheet_directory'); ?>/img/slate-facebook.png" />
    	</a>
    
     <script type="text/javascript">
    	a2a.init('page');
    </script>
    
    </div>

    Which get's repeated for each post. Ideally a solution would work along those lines.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags