Beispiel #1
0
 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;
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
    function section_template()
    {
        $border = $this->opt('ba_fotos_grid_loop_border') ? 'fotos-grid-border' : false;
        printf('<div class="ba-fotos-grid-loop-wrap"><ul class="ba-fotos-grid-loop-list %s fix">', $border);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $header = sprintf('<h5 itemprop="headline" class="ba-fotos-grid-loop-title"><a class="ba-fotos-grid-loop-title-link" href="%s" title="%s">%s</a></h5>', get_permalink(), get_the_title(), get_the_title());
                $html = '';
                $html .= printf('<li>');
                $img = sprintf('<a class="ba-fotos-grid-loop-link" href="%s" title="%s">%s</a>', get_permalink(), get_the_title(), get_the_post_thumbnail(get_the_ID(), 'medium'));
                $html .= printf('<header class="ba-fotos-grid-loop-header">%s%s</header>', $img, $header);
                $html .= printf('<section class="ba-fotos-grid-loop-entry">%s</section>', pl_short_excerpt(get_the_ID(), 40, '...'));
                $html .= printf('<footer class="ba-fotos-grid-loop-footer"></footer>');
                $html .= printf('</li>');
            }
        } else {
            echo 'Sorry no posts found';
        }
        printf('</ul></div>');
        if (function_exists('wp_pagenavi') && show_posts_nav()) {
            $args = array('before' => '<div class="pagination pagenavi">', 'after' => '</div>');
            wp_pagenavi($args);
        } elseif (show_posts_nav()) {
            //Checks to see if there is more than one page for nav.
            ?>
			<ul class="fotos-pagination fix">
				<li class="previous previous-entries">
					<?php 
            next_posts_link(__('&larr; Older Posts', 'fotos'));
            ?>
				</li>
				<li class="next next-entries">
					<?php 
            previous_posts_link(__('Newer Posts &rarr;', 'fotos'));
            ?>
				</li>
			</ul>
	<?php 
        }
    }
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 
}
Beispiel #5
0
 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);
    }
}
Beispiel #7
0
    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 
    }