Return to Snippet

Revision: 61073
at November 26, 2012 13:40 by mommygeekology

Initial Code
    function posttopsocial() { 
    // Let's put our code in a variable so we can use it more easily later
    $social = '<div id="posttopsocial"><a href="" class="twitter-share-button" data-count="horizontal" data-via="davidgadarian">Tweet</a><script type="text/javascript" src=""></script><g:plusone size="medium"></g:plusone>
<script src=""></script><script src=""></script><fb:like href="" send="false" layout="button_count" width="90" show_faces="false" font="tahoma"></fb:like><script src="" type="text/javascript"></script><script type="IN/Share" data-counter="right"></script></div>';

	// Now let's test for our conditions and decide what to show
	// Is it a single post? Is it the blog index?
	// is_home() tests for the WordPress blog index 
	// The page in question has an ID of 868
	if (is_single() || is_home() || is_page('868')) {
		echo $social; // show our social stuff!
	} else { 
		echo ''; // Don't echo anything, we don't want to show it
<?php }

Initial URL

Initial Description
Display some custom social media icons after the post title on certain pages/posts in Headway 3.x and php conditional logic

Initial Title
Social Share with PHP Logic - WordPress and Headway 3.0x

Initial Tags

Initial Language