Ejemplo n.º 1
0
    /**
     * Display Social Share, Print, Sent Button
     */
    function dw_focus_post_actions()
    {
        $post_id = get_the_ID();
        $url = rawurlencode(get_permalink());
        $title = rawurlencode(get_the_title());
        //Twitter
        $twitter_count = dw_get_twitter_count($url);
        $facebook_count = dw_get_facebook_count($url);
        $linkedin_count = dw_get_linkedin_count($url);
        ?>
		
		<div class="entry-action">
		<!-- Show author name/avatar -->
		<span class="author-name"><?php 
        echo get_avatar(get_the_author_email(), '24');
        ?>
  <?php 
        the_author();
        ?>
</span>
		<br>
		<!-- Show date -->
		<?php 
        $metadata = wp_get_attachment_metadata();
        printf(__('<span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span>', 'dw_focus'), esc_attr(get_the_date('c')), esc_html(get_the_date()));
        ?>

		<?php 
        $tags_list = get_the_tag_list('', __(', ', 'dw_focus'));
        if ($tags_list) {
            ?>
	    	<div class="tag-action">
		    	<span class="title-action"><?php 
            _e('Tags', 'dw_focus');
            ?>
</span>
		        <span class="tags-links">
		            <?php 
            printf(__('%1$s', 'dw_focus'), $tags_list);
            ?>
		        </span>
	        </div>
	        <?php 
        }
        // End if $tags_list
        ?>
		
		<br>
		<div class="social-action" data-nonce="<?php 
        echo wp_create_nonce('_dw_sharing_count_nonce');
        ?>
">
				<span class="title-action"><?php 
        _e('Sharing', 'dw_focus');
        ?>
</span>
				<ul>
					<li id="twitter-share" class="twitter" data-post-id="<?php 
        echo $post_id;
        ?>
" data-nonce="<?php 
        echo wp_create_nonce('_dw_focus_single_tweet_count_nonce');
        ?>
"><i class="icon-twitter"></i><a href="https://twitter.com/intent/tweet?url=<?php 
        echo $url;
        ?>
&amp;text=<?php 
        echo $title;
        ?>
"><?php 
        _e('Twitter', 'dw_focus');
        ?>
</a><span class="digit digit-twitter"><?php 
        echo $twitter_count;
        ?>
</span></li>
					<li class="facebook"><i class="icon-facebook-sign"></i><a href="https://www.facebook.com/sharer/sharer.php?u=<?php 
        echo $url;
        ?>
&amp;t=<?php 
        echo $title;
        ?>
" ><?php 
        _e('Facebook', 'dw_focus');
        ?>
</a><span class="digit digit-facebook"><?php 
        echo $facebook_count;
        ?>
</span></li>
					<li class="google"><i class="icon-google-plus-sign"></i><a href="https://plus.google.com/share?url=<?php 
        echo $url;
        ?>
" ><?php 
        _e('Google +', 'dw_focus');
        ?>
</a><span>0</span></li>
					<li class="linkedin"><i class="icon-linkedin-sign"></i><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<?php 
        echo $url;
        ?>
&amp;title=<?php 
        echo $title;
        ?>
&amp;summary=<?php 
        echo rawurlencode(get_the_excerpt());
        ?>
"><?php 
        _e('Linkedin', 'dw_focus');
        ?>
</a><span class="digit digit-linkedin"><?php 
        echo $linkedin_count;
        ?>
</span></li>
					<li class="email"><i class="icon-envelope-alt"></i><a href="mailto:?Subject=<?php 
        echo $title;
        ?>
&amp;body=<?php 
        echo $url;
        ?>
"><?php 
        _e('Email this article', 'dw_focus');
        ?>
</a></li>
                    <?php 
        if (!is_handheld()) {
            ?>
					<li class="print"><i class="icon-print"></i><a href="#" onclick="window.print();"><?php 
            _e('Print this article', 'dw_focus');
            ?>
</a></li>
                    <?php 
        }
        ?>
				</ul>
			</div>
		</div>
	<?php 
    }
Ejemplo n.º 2
0
    ?>
" title="<?php 
    _e('Share to Facebook', 'dw');
    ?>
" target='_blank'><i class="icon-facebook"></i><span><?php 
    echo dw_get_facebook_count($url);
    ?>
</span></a></li>
                <li><a  class="twitter" href="https://twitter.com/intent/tweet?source=webclient&amp;text=<?php 
    echo get_the_title() . rawurlencode($url);
    ?>
" title="<?php 
    _e('Share to Twitter', 'dw');
    ?>
"  target='_blank'><i class="icon-twitter"></i><span><?php 
    echo dw_get_twitter_count($url);
    ?>
</span></a></li>
                <li><a  class="googleplus" href="https://plus.google.com/share?url=<?php 
    echo rawurlencode($url);
    ?>
" title="<?php 
    _e('Share to Google+', 'dw');
    ?>
" target='_blank'><i class="icon-google-plus"></i><span><?php 
    echo dw_get_plusones_share_count($url);
    ?>
</span></a></li>
                <li><a href="#comments" class="comment" title="<?php 
    _e('Comment this post', 'dw');
    ?>