• Resolved Andreas

    (@slipkot)


    Hi Alexander,

    I am using the version you are providing at your website. Can you tell me how can i have the share buttons on every page? For the moment, they appear only at posts. I want them to appear at pages, posts and at front-page as a widget. Can you help me? Thanks in advance ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi,

    this is something I would also like to add – to have the social share buttons on the pages as well as posts.

    If someone is able to let us know how this is done.

    thanks

    Hey,

    You can try replace some code in page.php using child-theme or page templates.

    Locate:

    <div class="entry themeform">
      <?php the_content(); ?>
      <div class="clear"></div>
    </div><!--/.entry-->

    And replace this with code:

    <div class="entry themeform" <?php if ( !ot_get_option('sharrre') ) { echo 'share'; }; ?>">
    	<div class="entry-inner">
    		<?php the_content(); ?>
    	</div>
    	<?php if ( !ot_get_option('sharrre') ) { get_template_part('inc/sharrre'); } ?>
    	<div class="clear"></div>
    </div><!--/.entry-->

    It should work.

    minor typo:
    <div class="entry themeform <?php if ( !ot_get_option('sharrre') ) { echo 'share'; }; ?>">

    Thread Starter Andreas

    (@slipkot)

    Hi Admiral! The code you provided worked fine. Also, how can i add them as a widget at the frontpage? ??

    You can add a standart widget “Text Area” which contain simple text or HTML code and paste this line into it:
    <?php if ( !ot_get_option('sharrre') ) { get_template_part('inc/sharrre'); } ?>

    I think it would have worked too.

    Thread Starter Andreas

    (@slipkot)

    I tried it but it doesn’t appear anything.

    This worked fine for me (to get them onto the pages). Thank you.

    Thread Starter Andreas

    (@slipkot)

    For the pages it works for me too. I am talking about the widget on the frontpage that it doesn’t work…

    If You use a child-menu and Child theme You have to put child-menu.php into page-tempates directory in Your Child theme directory. Then You have to paste that piece of code to that file for proper working with that feature.

    After update to 2.1.1 there is a need to change code to :

    <div class="entry themeform" <?php if ( !ot_get_option('sharrre') != 'off' ) { echo 'share'; }; ?>">
    	<div class="entry-inner">
    		<?php the_content(); ?>
    	</div>
    	<?php if ( !ot_get_option('sharrre') != 'off' ) { get_template_part('inc/sharrre'); } ?>
    	<div class="clear"></div>
    </div><!--/.entry-->
    Thread Starter Andreas

    (@slipkot)

    Thanks for your help! You have a typo mistake. The correct is:

    <div class="entry themeform <?php if ( !ot_get_option('sharrre') != 'off' ) { echo 'share'; }; ?>">
    	<div class="entry-inner">
    		<?php the_content(); ?>
    	</div>
    	<?php if ( !ot_get_option('sharrre') != 'off' ) { get_template_part('inc/sharrre'); } ?>
    	<div class="clear"></div>
    </div><!--/.entry-->

    ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Share Buttons’ is closed to new replies.