当前位置: 首页>>代码示例>>PHP>>正文


PHP wpex_excerpt函数代码示例

本文整理汇总了PHP中wpex_excerpt函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_excerpt函数的具体用法?PHP wpex_excerpt怎么用?PHP wpex_excerpt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wpex_excerpt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: the_permalink

			<header>
			<h2 class="loop-entry-title"><a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    echo esc_attr(the_title_attribute('echo=0'));
    ?>
"><?php 
    the_title();
    ?>
</a></h2>
			<?php 
    // Display post meta details
    wpex_post_meta();
    ?>
			</header>
			<div class="loop-entry-content entry clr">
				<?php 
    if (get_theme_mod('wpex_entry_content_excerpt', 'excerpt') == 'content') {
        the_content();
    } else {
        $wpex_readmore = get_theme_mod('wpex_blog_readmore') == '1' ? true : false;
        wpex_excerpt(30, $wpex_readmore);
    }
    ?>
			</div><!-- .loop-entry-content -->
		</div><!-- .loop-entry-text -->
	</article><!-- .loop-entry -->

<?php 
}
开发者ID:kulgee001,项目名称:MyMusic-Wordpress,代码行数:31,代码来源:content-video.php

示例2: the_content

if ($check_more_tag && strpos(get_the_content(), 'more-link')) {
    ?>

				<?php 
    // Display entry content up to the more tag
    the_content('', '&hellip;');
    ?>

			<?php 
    // Generate custom excerpt
} else {
    ?>

				<?php 
    // Output excerpt with length of 40
    wpex_excerpt(array('length' => '40'));
    ?>

			<?php 
}
?>

		</div><!-- .custom-posttype-entry-excerpt -->

		<div class="custom-posttype-entry-readmore clr">

			<a href="<?php 
wpex_permalink();
?>
" class="theme-button" title="<?php 
wpex_esc_title();
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:31,代码来源:post-type-entry.php

示例3: vcex_testimonials_grid_shortcode


//.........这里部分代码省略.........
                }
                if (taxonomy_exists('testimonials_category')) {
                    $post_terms = get_the_terms($post, 'testimonials_category');
                    if ($post_terms) {
                        foreach ($post_terms as $post_term) {
                            $entry_classes .= ' cat-' . $post_term->term_id;
                        }
                    }
                }
                ?>
						<div id="#post-<?php 
                the_ID();
                ?>
" class="<?php 
                echo $entry_classes;
                ?>
">
							<div class="testimonial-entry-content clr">
								<span class="testimonial-caret"></span>
								<?php 
                // Custom Excerpt
                if ('true' == $excerpt) {
                    $read_more = $read_more == 'true' ? true : false;
                    if ('true' == $read_more) {
                        if (is_rtl()) {
                            $read_more_link = '...<a href="' . get_permalink() . '" title="' . $read_more_text . '">' . $read_more_text . '</a>';
                        } else {
                            $read_more_link = '...<a href="' . get_permalink() . '" title="' . $read_more_text . '">' . $read_more_text . '<span>&rarr;</span></a>';
                        }
                    } else {
                        $read_more_link = '...';
                    }
                    // Custom Excerpt function
                    if (function_exists('wpex_excerpt')) {
                        $args = array('post_id' => $post_id, 'length' => intval($excerpt_length), 'trim_custom_excerpts' => $custom_excerpt_trim, 'readmore' => false, 'more' => $read_more_link);
                        wpex_excerpt($args);
                    } else {
                        the_excerpt();
                    }
                } else {
                    the_content();
                }
                ?>
							</div><!-- .home-testimonial-entry-content-->
							<div class="testimonial-entry-bottom">
								<?php 
                if (has_post_thumbnail()) {
                    ?>
								<div class="testimonial-entry-thumb">
									<img src="<?php 
                    echo $img_url;
                    ?>
" alt="<?php 
                    echo the_title();
                    ?>
" <?php 
                    echo $img_border_radius;
                    ?>
 />
								</div><!-- /testimonial-thumb -->
								<?php 
                }
                ?>
								<div class="testimonial-entry-meta">
									<?php 
                if ($wpex_testimonial_author) {
开发者ID:sergey-h,项目名称:naman,代码行数:67,代码来源:testimonials_grid.php

示例4: wpex_post_entry_author_avatar

</a></h2>
				<?php 
    // Displays the post entry author avatar - see functions/post-entry-author-avatar.php
    wpex_post_entry_author_avatar();
    // Display post meta - see functions/post-meta.php
    wpex_post_meta();
    ?>
			</header>
			<div class="blog-entry-excerpt entry">
				<?php 
    // Display excerpt
    if (wpex_option('blog_exceprt', '1') == '1') {
        // Get excerpt length & output excerpt
        // See functions/excerpts.php
        $wpex_excerpt_length = wpex_excerpt_length();
        wpex_excerpt($wpex_excerpt_length);
    } else {
        the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'wpex'));
    }
    ?>
			</div><!-- .entry-excerpt -->
           <?php 
    // Read more link - see functions/post-readmore-link.php
    wpex_post_readmore_link();
    // Social sharing links
    wpex_social_share();
    ?>
		</div><!-- .blog-entry-content -->
    </article><!-- .blog-entry-entry -->

<?php 
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:31,代码来源:content-video.php

示例5: _e

							<li class="meta-date">
								<?php 
        _e('Posted on', 'wpex');
        ?>
								<span class="meta-date-text"><?php 
        echo get_the_date();
        ?>
</span>
							</li>
							
						</ul><!-- .post-meta -->
					</header>

					<div class="recent-blog-entry-content entry clr">
						<?php 
        wpex_excerpt(18, false);
        ?>
					</div><!-- .recent-blog-entry-content -->

				</article><!-- .recent-blog -->

			<?php 
        if ($wpex_count == '3') {
            $wpex_count = 0;
        }
        ?>

		<?php 
    }
    ?>
开发者ID:PlanoBWeb,项目名称:BDA,代码行数:30,代码来源:blog.php

示例6: wpex_excerpt

<?php

/**
 * Search entry excerpt
 *
 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
?>

<div class="search-entry-excerpt clr">
    <?php 
wpex_excerpt(array('length' => '30', 'readmore' => false, 'ignore_more_tag' => true));
?>
</div><!-- .search-entry-excerpt -->
开发者ID:iq007,项目名称:MadScape,代码行数:20,代码来源:search-entry-excerpt.php

示例7: wpex_get_permalink

                if ('false' != $read_more_rarr) {
                    $read_more_rarr_html = '<span>&rarr;</span>';
                } else {
                    $read_more_rarr_html = '';
                }
                // Read more text
                if (is_rtl()) {
                    $read_more_link = '...<a href="' . wpex_get_permalink() . '" title="' . esc_attr($read_more_text) . '">' . $read_more_text . '</a>';
                } else {
                    $read_more_link = '...<a href="' . wpex_get_permalink() . '" title="' . esc_attr($read_more_text) . '">' . $read_more_text . $read_more_rarr_html . '</a>';
                }
            } else {
                $read_more_link = '...';
            }
            // Custom Excerpt function
            wpex_excerpt(array('post_id' => $testimonial->ID, 'length' => intval($excerpt_length), 'more' => $read_more_link));
            // Display full post content
        } else {
            the_content();
        }
        ?>

						</div><!-- .entry -->

					</div><!-- .home-testimonial-entry-content-->

					<div class="testimonial-entry-bottom">

						<?php 
        // Check if post thumbnail is defined
        if (has_post_thumbnail() && 'true' == $entry_media) {
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:31,代码来源:vcex_testimonials_grid.php

示例8: wpex_get_featured_image_url

    echo wpex_get_featured_image_url();
    ?>
" alt="<?php 
    echo esc_attr(the_title_attribute('echo=0'));
    ?>
" />
			</a>
		</div><!-- .search-entry-thumb -->
    <?php 
}
?>
  
    <div class="search-entry-text">
        <header>
            <h2><a href="<?php 
the_permalink();
?>
" title="<?php 
echo esc_attr(the_title_attribute('echo=0'));
?>
"><?php 
the_title();
?>
</a></h2>
       </header>
        <?php 
// Custom excerpt function - see functions/excerpts.php
wpex_excerpt('30', true);
?>
    </div><!-- .search-entry-text -->
</article><!-- .entry -->
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:31,代码来源:content-search.php

示例9: the_permalink

	<?php 
}
?>

	<div class="search-entry-text clr">

		<header>
			<h2 class="search-entry-title"><a href="<?php 
the_permalink();
?>
" title="<?php 
echo esc_attr(the_title_attribute('echo=0'));
?>
"><?php 
the_title();
?>
</a></h2>
		</header>

		<div class="search-entry-content entry clr">

			<?php 
wpex_excerpt(50);
?>
			
		</div><!-- .search-entry-content -->

	</div><!-- .search-entry-text -->

</article><!-- .search-entry -->
开发者ID:PlanoBWeb,项目名称:BDA,代码行数:30,代码来源:entry.php

示例10: the_content

<?php

/**
 * Displays post entry content
 *
 * @package     Elegant WordPress theme
 * @subpackage  Partials
 * @author      Alexander Clarke
 * @link        http://www.wpexplorer.com
 * @since       1.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
?>

<div class="loop-entry-content entry clr">

	<?php 
// Display full content
if (get_theme_mod('wpex_entry_content_excerpt', 'excerpt') == 'content') {
    the_content();
} else {
    wpex_excerpt(93, get_theme_mod('wpex_blog_readmore', true));
}
?>

</div><!-- .loop-entry-content -->
开发者ID:PlanoBWeb,项目名称:BDA,代码行数:29,代码来源:content.php

示例11: wpex_social_share

    function wpex_social_share($post_id = NULL)
    {
        // Get sharing sites
        $defaults = array('twitter', 'facebook', 'google_plus', 'pinterest', 'linkedin');
        $sharing_sites = get_theme_mod('social_share_sites', $defaults);
        // Return nothing if there aren't any sites enabled
        if (empty($sharing_sites)) {
            return;
        }
        // Get post id
        $post_id = $post_id ? $post_id : wpex_get_the_id();
        // Don't show social sharing on password protected posts
        if (post_password_required($post_id)) {
            return;
        }
        // Check if disabled in page settings
        if ('on' == get_post_meta($post_id, 'wpex_disable_social', true)) {
            return;
        }
        // Get sharing options
        $position = get_theme_mod('social_share_position', 'horizontal');
        $style = get_theme_mod('social_share_style', 'minimal');
        // Output var
        $output = '';
        // Get and encode permalink
        $permalink = get_permalink($post_id);
        $url = urlencode($permalink);
        // 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 summar
        $args = array('length' => '40', 'echo' => false);
        $summary = urlencode(wpex_excerpt($args));
        // Get image
        $img = wp_get_attachment_url(get_post_thumbnail_id($post_id));
        // Source URL
        $source = home_url();
        // Sharing block heading
        $heading = wpex_option('social_share_heading', __('Please Share This', 'wpex'));
        $heading = apply_filters('wpex_social_share_heading', $heading);
        // Get post layout
        $post_layout = wpex_get_post_layout_class($post_id);
        // Only display horizontal style menu for mobile devices
        if (wp_is_mobile()) {
            $position = 'horizontal';
        }
        // Tooltip Style
        if (is_rtl()) {
            $tooltip_class = 'tooltip-right';
        } elseif ($position == 'horizontal') {
            $tooltip_class = 'tooltip-up';
        } else {
            if ($post_layout == 'left-sidebar') {
                $tooltip_class = 'tooltip-left';
            } else {
                $tooltip_class = 'tooltip-right';
            }
        }
        // Display heading on Boxed layout
        if ($position == 'horizontal') {
            ?>
			<div class="social-share-title theme-heading"><span><?php 
            echo $heading;
            ?>
</span></div>
		<?php 
        }
        ?>

		<ul class="social-share-buttons position-<?php 
        echo $position;
        ?>
 style-<?php 
        echo $style;
        ?>
 clr">
			<?php 
        // Loop through each social sharing site that is enabled
        foreach ($sharing_sites as $site) {
            // Twitter
            if ('twitter' == $site) {
                ?>
					<li class="share-twitter">
						<a href="http://twitter.com/share?text=<?php 
                echo $title;
                ?>
&amp;url=<?php 
                echo $url;
                ?>
" target="_blank" title="<?php 
                _e('Share on Twitter', 'wpex');
                ?>
" rel="nofollow" class="<?php 
                echo $tooltip_class;
                ?>
" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
							<span class="fa fa-twitter"></span>
							<?php 
                if ($position == 'horizontal') {
                    ?>
//.........这里部分代码省略.........
开发者ID:sergey-h,项目名称:naman,代码行数:101,代码来源:social-share(2).php

示例12: wpex_related_posts

    function wpex_related_posts()
    {
        // Return if disabled
        if (get_theme_mod('blog_related', '1') !== '1') {
            return;
        }
        // Get Post Data
        global $post;
        $post_id = $post->ID;
        // Return if not standard post type
        if (get_post_type($post) !== 'post') {
            return;
        }
        // Theme Settings
        $disable_related_items = get_post_meta($post_id, 'wpex_disable_related_items', true);
        $posts_per_page = get_theme_mod('blog_related_count', '3');
        // Create an array of current category ID's
        $cats = wp_get_post_terms($post_id, 'category');
        $cats_ids = array();
        foreach ($cats as $wpex_related_cat) {
            $cats_ids[] = $wpex_related_cat->term_id;
        }
        // Related query arguments
        $args = array('posts_per_page' => $posts_per_page, 'orderby' => 'rand', 'category__in' => $cats_ids, 'post__not_in' => array($post_id), 'no_found_rows' => true, 'tax_query' => array('relation' => 'AND', array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote', 'post-format-link'), 'operator' => 'NOT IN')));
        $wpex_query = new wp_query($args);
        if ($wpex_query->have_posts()) {
            ?>
			 <section class="related-posts clr">
				<div class="related-posts-title heading"><span><?php 
            _e('Related Posts', 'wpex');
            ?>
</span></div>
				<?php 
            // Loop through related posts
            $count = 0;
            foreach ($wpex_query->posts as $post) {
                setup_postdata($post);
                $count++;
                $postid = $post->ID;
                $attachment_id = get_post_thumbnail_id($postid);
                ?>
					<article class="related-post-entry span_1_of_3 col clr col-<?php 
                echo $count;
                ?>
">
						<?php 
                // Display related post thumbnail
                if (has_post_thumbnail()) {
                    ?>
							<a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    echo esc_attr(the_title_attribute('echo=0'));
                    ?>
" rel="bookmark" class="related-post-entry-thumbnail">
								<img src="<?php 
                    echo wpex_get_featured_img_url($attachment_id, false, false);
                    ?>
" alt="<?php 
                    echo the_title();
                    ?>
" />
								<?php 
                    if ('video' == get_post_format()) {
                        ?>
									<div class="related-post-entry-video-overlay"><i class="fa fa-play-circle-o"></i></div>
								<?php 
                    }
                    ?>
							</a>
						<?php 
                }
                ?>
						<div class="related-post-entry-content clr">
							<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                echo esc_attr(the_title_attribute('echo=0'));
                ?>
" rel="bookmark" class="related-post-entry-title"><?php 
                the_title();
                ?>
</a>
							<div class="related-post-entry-excerpt clr">
								<?php 
                wpex_excerpt('15', false);
                ?>
							</div><!-- related-post-entry-excerpt -->
						</div><!-- .related-post-entry-content -->
					</article><!-- .related-post-entry -->
				<?php 
            }
            ?>
			 </section>
		<?php 
        }
        // End related items
        // Reset query
//.........这里部分代码省略.........
开发者ID:kulgee001,项目名称:MyMusic-Wordpress,代码行数:101,代码来源:related-posts.php

示例13: the_permalink

									</a>
								</div><!-- .featured-slider-img -->
								<article class="featured-slider-caption">
									<h2 class="featured-slider-caption-title"><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            echo esc_attr(the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            the_title();
            ?>
</a></h2>
									<div class="featured-slider-caption-excerpt clr">
										<?php 
            echo wpex_excerpt('20');
            ?>
									</div><!-- .featured-slider-caption-excerpt -->
								</article><!--.featured-slider-caption -->
							</li><!-- .featured-slider-->
						<?php 
        }
        ?>
					</ul><!--.slides -->
				</div><!-- .flexslider -->
				<span class="featured-slider-preloader"><i class="fa fa-spinner fa-spin"></i></span>
			</div><!-- #featured-flexslider -->
		</div><!-- #featured-slider-wrap -->
	<?php 
    }
    ?>
开发者ID:kulgee001,项目名称:MyMusic-Wordpress,代码行数:31,代码来源:content-featured-slider.php

示例14: the_permalink

        the_permalink();
        ?>
" title="<?php 
        echo esc_attr(the_title_attribute('echo=0'));
        ?>
"><?php 
        the_title();
        ?>
</a>
			<?php 
    } else {
        ?>
				<?php 
        the_title();
        ?>
			<?php 
    }
    ?>
			</h2>
			<div class="staff-entry-excerpt clr">
				<?php 
    wpex_excerpt('40', false);
    ?>
			</div><!-- .staff-entry-excerpt -->
			<?php 
    echo wpex_get_staff_social();
    ?>
		</div><!-- .staff-entry-details -->
   </article><!-- .staff-entry -->
<?php 
}
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:31,代码来源:content-staff.php

示例15: apply_filters

 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Should we check for the more tag?
$check_more_tag = apply_filters('wpex_check_more_tag', true);
?>

<div class="blog-entry-excerpt wpex-clr">

    <?php 
// Display excerpt if auto excerpts are enabled in the admin
if (wpex_get_mod('blog_exceprt', true)) {
    // Check if the post tag is using the "more" tag
    if ($check_more_tag && strpos(get_the_content(), 'more-link')) {
        // Display the content up to the more tag
        the_content('', '&hellip;');
        // Otherwise display custom excerpt
    } else {
        // Display custom excerpt
        wpex_excerpt(array('length' => wpex_excerpt_length()));
    }
    // If excerpts are disabled, display full content
} else {
    the_content('', '&hellip;');
}
?>

</div><!-- .blog-entry-excerpt -->
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:blog-entry-content.php


注:本文中的wpex_excerpt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。