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'; }; ?>">
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.
I tried it but it doesn’t appear anything.
This worked fine for me (to get them onto the pages). Thank you.
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-->
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-->
π