I have simple function for displaying social buttons:
<?php function wc_social_buttons() {
global $post;
?>
<div class="social-buttons">
<div id="facebook" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?>" data-title=""></div>
<div id="twitter" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?>" data-title=""></div>
<div id="google-plus" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?>" data-title=""></div>
<div id="pinterest" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?>" data-title=""></div>
<div id="stumbleupon" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?>" data-title=""></div>
<div id="digg" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?>" data-title=""></div>
</div>
<div class="clear"></div>
<?php
}?>
Then i am using it in header of the page (for sticky menu) and in pages content. But it is displaying only in the header. All HTML this function returns drawing in page content, but displaying only in header. Any options display:none
do not used.
If i ramove function from header – all its HTML normally displaying in pages content.
May someone explain me what is this?…
Check with this
Header
Page Content
In your code change
Change Id as Class .
Now You can use two or more times
by calling the function
in a page.
your problem is that you are declaring it probably twice. for the second use in the body section only put this code: