WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddToAny
[resolved] Can I add it to my menu ? (3 posts)

  1. wwwchi
    Member
    Posted 1 year ago #

    Can I add it to my menu via "Appearance → Menus "?

    I've already install this pulgin.

    Putted this in index.php:
    <?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>

    And in the Menus, adding a Custom Links:
    URL: http://www.addtoany.com/share_save
    Label: my icon
    Title Attribute: Share
    CSS Classes: a2a_dd

    It can work at original type, but can't use new type what I setting via the pulgin.
    How can I do?
    Thanks a lot :)

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

  2. micropat
    Member
    Plugin Author

    Posted 1 year ago #

    Neat idea. Yes, by modifying your theme, you can place the AddToAny sharing button in a WordPress navigation menu.

    For example, you could modify the following in some theme's header.php file:

    <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>

    To this:

    <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'items_wrap' => '<ul id="%1$s" class="%2$s">'
        . ((function_exists('ADDTOANY_SHARE_SAVE_BUTTON')) ? ADDTOANY_SHARE_SAVE_BUTTON( array("html_wrap_open" => "<li>", "html_wrap_close" => "</li>", "output_later" => TRUE) ) : '')
        . '%3$s</ul>' ) ); ?>

    This will vary from theme to theme.

    Alternatively, if you wanted to stick to the interface in "Appearance → Menus " and have just 1 page shared (without the drop-down sharing menu), you could use this for the link URL:
    http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.example.com%2Fwordpress%2F&title=My%20WordPress

  3. wwwchi
    Member
    Posted 1 year ago #

    Because modify theme's file is not working.
    I use the second way : put link to my "Appearance → Menus " (it is just 1 page).
    The "Additional Options" is working. I can style it.

    But "Standalone Services" is not working. (it shows the original version.)

    Thank you~

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.