• Resolved davidz101

    (@davidz101)


    Hi,
    I found that the vertical floating share buttons are fixed in the left and it is too close to the left end, when the screen size is big, this GUI looks like not professional.

    I would like let the share button bar relative to content and I found that there are instructions in the FAQ as below

    In settings, disable the default placement of the Vertical Buttons. In your theme’s file(s), find the parent element that you want to position the vertical bar to (the parent element should have a specified width), then add the following PHP sample code as a child of that parent element: (source skipped)

    Can you please provide more detail on how to do it?
    1. I want to make the vertical bar show up in the home page and post page, which theme file I need to change?
    2. How to find the parent element for above 2 pages in the theme files?
    3. How to add the php sample code as a child of that parent element?

    I think lots of people would like to have this change if he chooses to use the vertical button, providing the more detail solution will make more users to use this plugin.

    Thank you!

    -David

    https://www.ads-software.com/plugins/add-to-any/

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

    (@micropat)

    Hi David, you’ll want support for your theme based on those directions, because themes can be wildly different and sometime have preferred ways for doing this kind of thing.

    Thread Starter davidz101

    (@davidz101)

    Hi,
    Can you provide it in the package? or provide an example on how to make the change in the default theme such as “Twenty Fifteen”? so people can figure it out in their own theme similarly. Otherwise, it would be difficult to make the change.
    Thanks
    -David

    Plugin Author micropat

    (@micropat)

    In the Twenty Fifteen theme, the parent element you would want is div#primary on line 19 of twentyfifteen’s index.php file.

    Example placement in that file:

    <div id="primary" class="content-area">
    
    	<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_FLOATING' ) ) {
    		ADDTOANY_SHARE_SAVE_FLOATING( array(
    			'kit_style' => 'margin-left:-10px; top:150px;',
    			'vertical_type' => true,
    		) );
    	} ?>
    
    	<main id="main" class="site-main" role="main">
    Thread Starter davidz101

    (@davidz101)

    Hi,
    I tried it and it does not works. below are what I did.
    1. activate the twentyfifteen theme.
    2. go to control panel ==> appearance=> editor => edit the file index.php.
    3. copy and paste the following
    <?php if ( function_exists( ‘ADDTOANY_SHARE_SAVE_FLOATING’ ) ) {
    ADDTOANY_SHARE_SAVE_FLOATING( array(
    ‘kit_style’ => ‘margin-left:-10px; top:150px;’,
    ‘vertical_type’ => true,
    ) );
    } ?>

    into the place.
    4. refresh the home page, I found that it does not work
    5. I view the page resource and find that there is nothing added below the <div id=”primary” …>

    Please try on your end to verify this solution is working for not. if possible, please send me the generated HTML source code, I may just directly add it as a short cut. but I would prefer that I can add the <?php ..?> code which provides the protection.

    Thanks
    -David

    Plugin Author micropat

    (@micropat)

    It’s verified to work as long as the plugin is activated. Make sure that your changes to index.php are changing your homepage, and that a cache isn’t getting in the way.

    Thread Starter davidz101

    (@davidz101)

    Hi, I double checked and I did add it in the index.php file, but somehow it does not show up. I tried in the local machine, so there is no cache, would like mind just post the code this script generate? I will directly copy and paste to the index.php file as a shortcut.

    Thanks
    -David

    Plugin Author micropat

    (@micropat)

    Odd that it doesn’t show for you.

    Here’s the general HTML code you can use alongside the plugin:

    <div class="a2a_kit a2a_kit_size_32 a2a_floating_style a2a_vertical_style" style="margin-left:-10px; top:150px;">
    	<a class="a2a_button_facebook"></a>
    	<a class="a2a_button_twitter"></a>
    	<a class="a2a_button_google_plus"></a>
    	<a class="a2a_dd addtoany_share_save"></a>
    </div>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘how to position a vertical floating share buttons bar relative to content?’ is closed to new replies.