コード例 #1
0
 while ($wpex_query->have_posts()) {
     // Get post from query
     $wpex_query->the_post();
     // Create new post object.
     $post = new stdClass();
     // Get post data
     $get_post = get_post();
     // Post Data
     $post->ID = $get_post->ID;
     $post->title = $get_post->post_title;
     $post->permalink = wpex_get_permalink($post->ID);
     $post->format = get_post_format($post->ID);
     $post->excerpt = '';
     // Post Excerpt
     if ('true' == $excerpt) {
         $post->excerpt = wpex_get_excerpt(array('length' => intval($excerpt_length)));
     }
     // Counter
     $count++;
     // Get video
     if ('video' == $post->format) {
         $post->video = wpex_get_post_video($post->ID);
         $post->video_oembed = wpex_get_post_video_html($post->video);
     }
     // Entry Classes
     $entry_classes = array('vcex-blog-entry');
     $entry_classes[] = 'span_1_of_' . $columns;
     $entry_classes[] = 'col-' . $count;
     if ('false' == $columns_responsive) {
         $entry_classes[] = 'nr-col';
     } else {
コード例 #2
0
$post_id = wpex_global_obj('post_id');
// Get sharing settings
$position = wpex_social_share_position();
$style = wpex_social_share_style();
// Get heading
$heading = wpex_social_share_heading();
// Get and encode permalink
$permalink = get_permalink($post_id);
$url = urlencode($permalink);
$url = apply_filters('wpex_social_share_url', $url);
// Get and encode title
$args = array('before' => false, 'after' => false, 'echo' => false, 'post' => $post_id);
$title = urlencode(esc_attr(the_title_attribute($args)));
// Get and encode summary
$args = array('length' => '40', 'echo' => false, 'ignore_more_tag' => true);
$summary = urlencode(wpex_get_excerpt($args));
// Get image
$img = wp_get_attachment_url(get_post_thumbnail_id($post_id));
$img = esc_url($img);
// Source URL
$source = home_url();
?>

<div class="wpex-social-share-wrap clr position-<?php 
echo $position;
if ('full-screen' == wpex_global_obj('post_layout')) {
    echo ' container';
}
?>
">
コード例 #3
0
ファイル: vcex_staff_grid.php プロジェクト: iq007/MadScape
			<?php 
    // Define counter var to clear floats
    $count = 0;
    // Start loop
    while ($wpex_query->have_posts()) {
        // Get post from query
        $wpex_query->the_post();
        // Create new post object
        $post = new stdClass();
        // Post Data
        $post->ID = get_the_ID();
        $post->permalink = wpex_get_permalink($post->ID);
        $post->excerpt = '';
        // Post Excerpt
        if ('true' == $excerpt || 'true' == $thumb_lightbox_caption) {
            $post->excerpt = wpex_get_excerpt($excerpt_length);
        }
        // Add to the counter var
        $count++;
        // Add classes to the entries
        $entry_classes = array('staff-entry');
        $entry_classes[] = 'span_1_of_' . $columns;
        if ('false' == $columns_responsive) {
            $entry_classes[] = 'nr-col';
        } else {
            $entry_classes[] = 'col';
        }
        if ($count) {
            $entry_classes[] = 'col-' . $count;
        }
        if ('true' == $read_more) {
コード例 #4
0
ファイル: excerpts.php プロジェクト: iq007/MadScape
/**
 * Get or generate excerpts
 *
 * @since Total 1.0.0
 */
function wpex_excerpt($args)
{
    echo wpex_get_excerpt($args);
}
コード例 #5
0
ファイル: social-share.php プロジェクト: iq007/MadScape
}
// Get sharing sites
$sites = wpex_social_share_sites();
// Return if there aren't any sites enabled
if (empty($sites)) {
    return;
}
// Declare main vars
$position = wpex_social_share_position();
$style = wpex_social_share_style();
$heading = wpex_social_share_heading();
$post_id = wpex_global_obj('post_id');
$url = apply_filters('wpex_social_share_url', get_permalink($post_id));
$title = html_entity_decode(wpex_get_esc_title());
// Get and encode summary
$summary = wpex_get_excerpt(array('length' => '40', 'echo' => false, 'ignore_more_tag' => true));
?>

<div class="wpex-social-share-wrap clr position-<?php 
echo esc_attr($position);
if ('full-screen' == wpex_global_obj('post_layout')) {
    echo ' container';
}
?>
">

	<?php 
// Display heading if enabled
if (wpex_get_mod('social_share_heading_enable', true) && 'horizontal' == $position) {
    ?>
コード例 #6
0
 * @package Total WordPress Theme
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Only used for inside position
if ('inside_link' != $position) {
    return;
}
// Get excerpt length
$excerpt_length = isset($args['overlay_excerpt_length']) ? $args['overlay_excerpt_length'] : 15;
// Generate Excerpt
$excerpt = wpex_get_excerpt(array('length' => $excerpt_length));
// Make sure excerpt isn't too long when custom
if (strlen($excerpt) > $excerpt_length) {
    $excerpt = wp_trim_words($excerpt, $excerpt_length);
}
?>

<div class="overlay-title-excerpt-hover overlay-hide theme-overlay">

    <div class="overlay-title-excerpt-hover-inner clr">

        <div class="overlay-title-excerpt-hover-text clr">

            <h3 class="overlay-title-excerpt-hover-title">
                <?php 
the_title();
コード例 #7
0
 function wpex_social_share($postid = false)
 {
     // Bail
     $site_layout = wpex_option('main_layout_style', 'full-width');
     if ($site_layout == 'boxed' && !is_singular()) {
         return;
     }
     if (post_password_required()) {
         return;
     }
     // Get sharing options
     $sharing_sites = wpex_option('social_share_sites');
     if (empty($sharing_sites)) {
         return;
     }
     // Get post
     global $post;
     $postid = $postid ? $postid : $post->ID;
     if (!$postid) {
         return;
     }
     $post_type = get_post_type($post);
     $meta = get_post_meta($postid, 'wpex_disable_social', true);
     // If disabled show nothing
     if ($meta == 'true') {
         return;
     }
     if (!is_singular('post') && ($post_type = 'post' && wpex_option('social_share_blog_entries', '1') !== '1')) {
         return;
     }
     if (is_singular('post') && wpex_option('social_share_blog_posts', '1') !== '1') {
         return;
     }
     if (is_singular('page') && wpex_option('social_share_pages', '1') !== '1') {
         return;
     }
     if (is_singular('portfolio') && wpex_option('social_share_portfolio', '1') !== '1') {
         return;
     }
     if (class_exists('Woocommerce')) {
         if (is_singular('product') && is_woocommerce() && wpex_option('social_share_woo') !== '1') {
             return;
         }
         if (!is_singular('product') && is_woocommerce()) {
             return;
         }
         if (is_cart() || is_checkout()) {
             return;
         }
     }
     // Vars
     $url = get_permalink($postid);
     $url = urlencode($url);
     $title = esc_attr(the_title_attribute('echo=0'));
     $summary = wpex_get_excerpt('40');
     $img = wp_get_attachment_url(get_post_thumbnail_id($postid));
     $source = home_url();
     $social_share_title = __('Please Share This', 'wpex');
     $social_share_title = apply_filters('wpex_social_share_title', $social_share_title);
     $wpex_post_layout = wpex_get_post_layout_class();
     $output = '';
     // Tooltip Style
     if (is_rtl()) {
         $tooltip_class = 'tooltip-right';
     } elseif ($site_layout == 'boxed') {
         $tooltip_class = 'tooltip-up';
     } else {
         if ($wpex_post_layout == 'left-sidebar') {
             $tooltip_class = 'tooltip-left';
         } else {
             $tooltip_class = 'tooltip-right';
         }
     }
     // Display heading on Boxed layout
     if (is_singular()) {
         $output .= '<div class="social-share-title theme-heading"><span>' . $social_share_title . '</span></div>';
     }
     // Open URL
     $output .= '<ul class="social-share-buttons clr">';
     // Loop through them
     foreach ($sharing_sites as $key => $value) {
         // Twitter
         if ($key == 'twitter' && $value) {
             $output .= '<li class="share-twitter"><a href="http://twitter.com/share?text=' . $title . '&url=' . $url . '" target="_blank" title="' . __('Share on Twitter', 'wpex') . '" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-twitter"></span></a></li>';
         }
         // Facebook
         if ($key == 'facebook' && $value) {
             $output .= '<li class="share-facebook"><a href="http://www.facebook.com/sharer.php?s=100&p[url]=' . $url . '&p[images][0]=' . $img . '&p[title]=' . $title . '&p[summary]=' . $summary . '" target="_blank" title="' . __('Share on Facebook', 'wpex') . '" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-facebook"></span></a></li>';
         }
         // Google+
         if ($key == 'google_plus' && $value) {
             $output .= '<li class="share-googleplus"><a title="' . __('Share on Google+', 'wpex') . '" rel="external" href="https://plusone.google.com/_/+1/confirm?url=' . $url . '" target="_blank" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-google-plus"></span></a></li>';
         }
         // Pinterest
         if ($key == 'pinterest' && $value) {
             $output .= '<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=' . $url . '&media=' . $img . '&description=' . $summary . '" target="_blank" title="' . __('Share on Pinterest', 'wpex') . '" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-pinterest"></span></a></li>';
         }
         // LinkedIn
         if ($key == 'linkedin' && $value) {
             $output .= '<li class="share-linkedin"><a title="' . __('Share on LinkedIn', 'wpex') . '" rel="external" href="http://www.linkedin.com/shareArticle?mini=true&url=' . $url . '&title=' . $title . '&summary=' . $summary . '&source=' . $source . '" target="_blank" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-linkedin"></span></a></li>';
         }
     }
     // Close UL
     $output .= '</ul>';
     // Echo the social sharing icons
     echo $output;
 }