function get_shares() { global $post; $perm = get_permalink($post->ID); $title = wp_strip_all_tags(get_the_title($post->ID)); $thumb = has_post_thumbnail($post->ID) ? pl_the_thumbnail_url($post->ID) : ''; $desc = wp_strip_all_tags(pl_short_excerpt($post->ID, 10, '')); $out = ''; if (ploption('share_google')) { $out .= self::google(array('permalink' => $perm)); } if (ploption('share_twitter')) { $out .= self::twitter(array('permalink' => $perm, 'title' => $title)); } if (ploption('share_facebook')) { $out .= self::facebook(array('permalink' => $perm)); } if (ploption('share_linkedin')) { $out .= self::linkedin(array('permalink' => $perm, 'title' => $title)); } if (ploption('share_pinterest')) { $out .= self::pinterest(array('permalink' => $perm, 'image' => $thumb, 'desc' => $desc)); } if (ploption('share_buffer')) { $out .= self::buffer(array('permalink' => $perm, 'title' => $title)); } if (ploption('share_stumble')) { $out .= self::stumbleupon(array('permalink' => $perm, 'title' => $title)); } return $out; }
function get_shares() { global $post; if (!is_object($post)) { return; } $perm = get_permalink($post->ID); $title = wp_strip_all_tags(get_the_title($post->ID)); $thumb = has_post_thumbnail($post->ID) ? pl_the_thumbnail_url($post->ID) : ''; $desc = wp_strip_all_tags(pl_short_excerpt($post->ID, 10, '')); $out = ''; return $out; }
function pl_recent_posts($number = 3) { ?> <ul class="media-list"> <?php foreach (get_posts(array('numberposts' => $number)) as $p) { $img_src = has_post_thumbnail($p->ID) ? pl_the_thumbnail_url($p->ID, 'thumbnail') : ''; $img = $img_src != '' ? sprintf('<div class="img"><a class="the-media" href="%s" style="background-image: url(%s)"></a></div>', get_permalink($p->ID), $img_src) : ''; printf('<li class="media fix">%s<div class="bd"><div class="wrp"><a class="title" href="%s">%s</a><span class="excerpt">%s</span></div></div></li>', $img, get_permalink($p->ID), $p->post_title, pl_short_excerpt($p->ID, 6)); } ?> </ul> <?php }
function icon_mode() { global $post; $excerpt = wp_strip_all_tags(pl_short_excerpt($post->ID, 10, '')); $perm = get_permalink($post->ID); $title = wp_strip_all_tags(get_the_title($post->ID)); $thumb = has_post_thumbnail($post->ID) ? pl_the_thumbnail_url($post->ID) : ''; $handle = pl_setting('twittername'); $getsep = pl_setting('ba_fotos_social_separator'); $sep = $getsep ? printf('<span class="ba-fotos-social-post-delimiter">%s</span>', $getsep) : false; $out = ''; $out .= sprintf('<a href="http://twitter.com/home?status=%s %s via @%s"><i class="icon-twitter icon-fotos icon-fotos-default"></i></a>%s', $title, $perm, $handle, $sep); $out .= sprintf('<a href="http://www.facebook.com/sharer/sharer.php?s=100&p[url]=%s&p[images][0]=%s&p[title]=%s&p[summary]=%s"><i class="icon-facebook icon-fotos icon-fotos-default"></i></a>%s', $perm, $thumb, $title, $excerpt, $sep); $out .= sprintf('<a href="http://pinterest.com/pin/create/button/?url=%s&media=%s&description=%s"><i class="icon-pinterest icon-fotos icon-fotos-default"></i></a>%s', $perm, $thumb, $excerpt, $sep); $out .= sprintf('<a href="#" class="fotos-back-to-top"><i class="icon-arrow-up icon-fotos icon-fotos-default"></i></a>'); return $out; }
/** * * @TODO do * */ function pagelines_facebook_header() { if (is_home() || is_archive()) { return; } if (function_exists('is_bbpress') && is_bbpress()) { return; } global $pagelines_ID; if (!$pagelines_ID) { return; } $fb_img = apply_filters('pl_opengraph_image', pl_the_thumbnail_url($pagelines_ID, 'full')); echo pl_source_comment('Facebook Open Graph'); printf("<meta property='og:title' content='%s' />\n", get_the_title($pagelines_ID)); printf("<meta property='og:url' content='%s' />\n", get_permalink($pagelines_ID)); printf("<meta property='og:site_name' content='%s' />\n", get_bloginfo('name')); $fb_content = get_post($pagelines_ID); if (!function_exists('sharing_plugin_settings')) { printf("<meta property='og:description' content='%s' />\n", pl_short_excerpt($fb_content, 15)); } printf("<meta property='og:type' content='%s' />", is_home() ? 'website' : 'article'); if ($fb_img) { printf("\n<meta property='og:image' content='%s' />", $fb_img); } }
function section_template() { global $plpg; $pageID = $plpg->id; $num_posts = 4; ?> <div class="widget"> <div class="widget-pad"> <div class="the-rapid-tabs"> <ul class="tabbed-list rapid-nav fix"> <li><a href="#rapid-popular"><?php _e('Popular', 'pagelines'); ?> </a></li> <li><a href="#rapid-recent"><?php _e('Recent', 'pagelines'); ?> </a></li> <li><a href="#rapid-comments"><?php _e('Comments', 'pagelines'); ?> </a></li> <li><a href="#rapid-tags"><?php _e('Tags', 'pagelines'); ?> </a></li> </ul> <div id="rapid-popular"> <ul class="media-list"> <?php foreach (get_posts(array('numberposts' => $num_posts, 'ignore_sticky_posts' => 1, 'orderby' => 'meta_value', 'meta_key' => '_pl_karma', 'exclude' => $pageID)) as $p) { $img = has_post_thumbnail($p->ID) ? sprintf('<div class="img"><a class="the-media" href="%s" style="background-image: url(%s)"></a></div>', get_permalink($p->ID), pl_the_thumbnail_url($p->ID, 'thumbnail')) : ''; printf('<li class="media fix">%s<div class="bd"><a class="title" href="%s">%s</a><span class="excerpt">%s</span></div></li>', $img, get_permalink($p->ID), $p->post_title, pl_short_excerpt($p->ID)); } ?> </ul> </div> <div id="rapid-recent"> <ul class="media-list"> <?php foreach (get_posts(array('ignore_sticky_posts' => 1, 'orderby' => 'post_date', 'order' => 'desc', 'numberposts' => $num_posts, 'exclude' => $pageID)) as $p) { $img = has_post_thumbnail($p->ID) ? sprintf('<div class="img"><a class="the-media" href="%s" style="background-image: url(%s)"></a></div>', get_permalink($p->ID), pl_the_thumbnail_url($p->ID, 'thumbnail')) : ''; printf('<li class="media fix">%s<div class="bd"><a class="title" href="%s">%s</a><span class="excerpt">%s</span></div></li>', $img, get_permalink($p->ID), $p->post_title, pl_short_excerpt($p->ID)); } ?> </ul> </div> <div id="rapid-comments"> <ul class="quote-list"> <?php pl_recent_comments(); ?> </ul> </div> <div id="rapid-tags"> <div class="tags-list"> <?php wp_tag_cloud(array('number' => 30, 'smallest' => 10, 'largest' => 10)); ?> </div> </div> </div> </div> </div> <?php }