Could someone help me change icon orientation issue on a WP page? I am a novice when dealing with this plugin php code for the most part, though suspect their is caching going on! I trust I need help with php, css and maybe even WordPress itself in solving two issues here. 1) as indicated at the end of the code snippet the resulting icons return as a vertical list on a website page. I would like them to be in a horizontal orientation following the Title “Share this:” 2) At the moment, these icons appear at the bottom of both ‘pages’ and ‘posts’. I would like them to appear only for ‘posts’. I trust I need php conditional code added to do so.
I was looking for a simple way of posting things from a website to email, facebook or twitter and this (open-source, modifiable)WordPress plugin seemed to fill the bill without any major overload as indicated by some other alternatives (except for the two changes I detailed above.) I can’t seem to raise the author to work it through!!!
Plug In code snippet:
function jw_share_this_links($content) {
$id = get_the_ID();
$title = get_the_title($id);
$url = get_permalink($id);
$content .= "\n";
$content .= "<div class=\"jwsharethis\">\n"; (There is no corresponding css entries)
$content .= "Share this: \n";
$content .= "<br />\n";
$content .= "<a href=\"mailto:?subject=" . rawurlencode($title) . "&amp;body=" . rawurlencode($url) . "\">\n";
$content .= "<img src=\"" . plugins_url('email.png', __FILE__) . "\" alt=\"Share this page via Email\" />\n";
$content .= "</a>\n";
$content .= "<a target=\"_blank\" href=\"" . urlencode($url) . "&amp;t=" . urlencode($title) . "\">\n";
$content .= "<img src=\"" . plugins_url('fb.png', __FILE__) . "\" alt=\"Share this page via Facebook\" />\n";
$content .= "</a>\n";
$content .= "<a target=\"_blank\" href=\"" . urlencode($url) . "&amp;title=" . urlencode($title) . "\">\n";
$content .= "<img src=\"" . plugins_url('twitter.png', __FILE__) . "\" alt=\"Share this page via Twitter\" />\n";
$content .= "</a>\n";
$content .= "</div>\n";
return $content;
add_filter ('the_content', 'jw_share_this_links');
Results can be seen in a sample website page ( Icons are included in the plugin.