• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP evolve_truncate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: evolve_posts_slider

function evolve_posts_slider()
{
    ?>
    <div id="slide_holder">
        <div class="slide-container">

            <ul id="slides">

                <?php 
    $number_items = evolve_get_option('evl_posts_number', '5');
    $slider_content = evolve_get_option('evl_posts_slider_content', 'recent');
    $slider_content_category = '';
    $slider_content_category = evolve_get_option('evl_posts_slider_id', '');
    //make array categories into string with commas.
    if (is_array($slider_content_category)) {
        $slider_content_category = implode(",", $slider_content_category);
    }
    if ($slider_content == "category" && !empty($slider_content_category)) {
        $slider_content_ID = $slider_content_category;
    } else {
        $slider_content_ID = '';
    }
    $args = array('cat' => $slider_content_ID, 'showposts' => $number_items, 'ignore_sticky_posts' => 1);
    query_posts($args);
    if (have_posts()) {
        $featured = new WP_Query($args);
        while ($featured->have_posts()) {
            $featured->the_post();
            ?>

                        <li class="slide">

                            <?php 
            if (has_post_thumbnail()) {
                echo '<div class="featured-thumbnail"><a href="';
                the_permalink();
                echo '">';
                the_post_thumbnail('slider-thumbnail');
                echo '</a></div>';
            } else {
                $image = evolve_get_first_image();
                if ($image) {
                    echo '<div class="featured-thumbnail"><a href="';
                    the_permalink();
                    echo '"><img src="' . $image . '" alt="';
                    the_title();
                    echo '" /></a></div>';
                }
            }
            ?>

                            <h2 class="featured-title">
                                <a class="title" href="<?php 
            the_permalink();
            ?>
">
                                    <?php 
            $title = the_title('', '', false);
            $length = evolve_get_option('evl_posts_slider_title_length', 40);
            echo evolve_truncate($title, $length, '...');
            ?>
                                </a>
                            </h2>

                            <p><?php 
            $excerpt_length = evolve_get_option('evl_posts_slider_excerpt_length', 40);
            echo evolve_excerpt_max_charlength($excerpt_length);
            ?>
</p>
                            <a class="button post-more" href="<?php 
            the_permalink();
            ?>
"><?php 
            _e('Read more', 'evolve');
            ?>
</a>

                        </li>

                    <?php 
        }
        ?>

                <?php 
    } else {
        ?>
                    <li><?php 
        _e('<h2 style="color:#fff;">Oops, no posts to display! Please check your post slider Category (ID) settings</h2>', 'evolve');
        ?>
</li>

                <?php 
    }
    ?>
                <?php 
    wp_reset_query();
    ?>
            </ul>
        </div> 
    </div>
//.........这里部分代码省略.........
开发者ID:berniecultess,项目名称:infirev,代码行数:101,代码来源:basic-functions.php


示例2: the_permalink

                    <?php 
            } else {
                ?>

                        <h1 class="entry-title">
                            <a href="<?php 
                the_permalink();
                ?>
" rel="bookmark" title="Permanent Link to <?php 
                the_title();
                ?>
">
                                <?php 
                if (get_the_title()) {
                    $title = the_title('', '', false);
                    echo evolve_truncate($title, $evolve_posts_excerpt_title_length, '...');
                }
                ?>
                            </a>
                        </h1>
                        <?php 
                if ($evolve_edit_post == "1") {
                    ?>
                        <?php 
                    if (current_user_can('edit_post', $post->ID)) {
                        ?>
                            <?php 
                        edit_post_link(__('EDIT', 'evolve'), '<span class="edit-post edit-attach">', '</span>');
                        ?>
                        <?php 
                    }
开发者ID:berniecultess,项目名称:infirev,代码行数:31,代码来源:search.php


示例3: the_permalink

	<?php 
                } else {
                    ?>
	
		<h1 class="entry-title"><a href="<?php 
                    the_permalink();
                    ?>
" rel="bookmark" title="Permanent Link to <?php 
                    the_title();
                    ?>
">
	
		<?php 
                    if (get_the_title()) {
                        $title = the_title('', '', false);
                        echo evolve_truncate($title, 40, '...');
                    }
                    ?>
</a> </h1>
		
		<?php 
                    if (current_user_can('edit_post', $post->ID)) {
                        ?>
			<?php 
                        edit_post_link(__('EDIT', 'evolve'), '<span class="edit-post edit-attach">', '</span>');
                        ?>
		<?php 
                    }
                    ?>
	
	<?php 
开发者ID:migumuno,项目名称:obesity,代码行数:31,代码来源:index.php


示例4: widget


//.........这里部分代码省略.........
                    if (has_post_thumbnail()) {
                        ?>
                                                        <div class="image">
                                                            <a href="<?php 
                        the_permalink();
                        ?>
">
                                                                <?php 
                        the_post_thumbnail('tabs-img');
                        ?>
                                                            </a>
                                                        </div>
                                                    <?php 
                    }
                    ?>
                                                    <div class="post-holder">
                                                        <a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a>

                                                        <div class="meta">
                                                            <?php 
                    the_time(get_option('date_format'));
                    ?>
                                                        </div>
                                                    </div>
                                                </li>
                                            <?php 
                }
                ?>
                                        </ul>
                                    <?php 
            }
            ?>
                            </div>
                        <?php 
        }
        ?>
                        <?php 
        if ($show_comments == 'true') {
            ?>
                            <div id="tab-comments" class="tab tab_content" style="display: none;">
                                <ul class="news-list">
                                    <?php 
            $number = $instance['comments'];
            global $wpdb;
            $recent_comments = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,110) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$number}";
            $the_comments = $wpdb->get_results($recent_comments);
            foreach ($the_comments as $comment) {
                ?>
                                            <li>
                                                <div class="image">
                                                    <?php 
                echo get_avatar($comment, '50');
                ?>
                                                </div>
                                                <div class="post-holder">
                                                    <a class="comment-text-side" href="<?php 
                echo get_permalink($comment->ID);
                ?>
#comment-<?php 
                echo $comment->comment_ID;
                ?>
" title="<?php 
                echo strip_tags($comment->comment_author);
                ?>
 on <?php 
                echo $comment->post_title;
                ?>
"><?php 
                echo strip_tags($comment->comment_author);
                _e('says', 'evolve');
                ?>
</a>

                                                    <div class="meta">
                                                        <?php 
                echo evolve_truncate(strip_tags($comment->com_excerpt), 70);
                ?>
                                                    </div>
                                                </div>
                                            </li>
                                        <?php 
            }
            ?>
                                </ul>
                            </div>
                        <?php 
        }
        ?>
                    </div>
                </div>
            </div>
            <?php 
        echo $after_widget;
    }
开发者ID:renzotello,项目名称:gitWebTrevor,代码行数:101,代码来源:tabs-widget.php


示例5: get_the_content

     </a></span>';
                }
            }
            ?>
                <?php 
        }
        ?>

          
          <?php 
        $postexcerpt = get_the_content();
        $postexcerpt = apply_filters('the_content', $postexcerpt);
        $postexcerpt = str_replace(']]>', ']]&gt;', $postexcerpt);
        $postexcerpt = strip_tags($postexcerpt);
        $postexcerpt = strip_shortcodes($postexcerpt);
        echo evolve_truncate($postexcerpt, 350, ' [...]');
        ?>
          
          
          <div class="entry-meta entry-footer">
          
          <div class="read-more btn btn-right icon-arrow-right">
           <a href="<?php 
        the_permalink();
        ?>
"><?php 
        _e('READ MORE', 'evolve');
        ?>
</a>
           </div>
          
开发者ID:thejasonhsu,项目名称:Illumin,代码行数:30,代码来源:content-blog.php


示例6: evolve_posts_slider

function evolve_posts_slider()
{
    ?>


 <div id="slide_holder">    
 <div class="slide-container">

<ul id="slides">
		
    <?php 
    $number_items = evolve_get_option('evl_posts_number', '5');
    $slider_content = evolve_get_option('evl_posts_slider_content', 'recent');
    $slider_content_category = '';
    $slider_content_category = evolve_get_option('evl_posts_slider_id', '');
    if ($slider_content == "category" && !empty($slider_content_category)) {
        $slider_content_ID = $slider_content_category;
    } else {
        $slider_content_ID = '';
    }
    $args = array('cat' => $slider_content_ID, 'showposts' => $number_items, 'ignore_sticky_posts' => 1);
    query_posts($args);
    ?>


<?php 
    if (have_posts()) {
        $featured = new WP_Query($args);
        while ($featured->have_posts()) {
            $featured->the_post();
            ?>

<li class="slide">
          
<?php 
            if (has_post_thumbnail()) {
                echo '<div class="featured-thumbnail"><a href="';
                the_permalink();
                echo '">';
                the_post_thumbnail('slider-thumbnail');
                echo '</a></div>';
            } else {
                $image = evolve_get_first_image();
                if ($image) {
                    echo '<div class="featured-thumbnail"><a href="';
                    the_permalink();
                    echo '"><img src="' . $image . '" alt="';
                    the_title();
                    echo '" /></a></div>';
                }
            }
            ?>
 

<h2 class="featured-title">
<a class="title" href="<?php 
            the_permalink();
            ?>
">
<?php 
            $title = the_title('', '', false);
            echo evolve_truncate($title, 40, '...');
            ?>
</a> 
</h2> 


 

<p>
<?php 
            $postexcerpt = get_the_content();
            $postexcerpt = apply_filters('the_content', $postexcerpt);
            $postexcerpt = str_replace(']]>', ']]&gt;', $postexcerpt);
            $postexcerpt = strip_tags($postexcerpt);
            $postexcerpt = strip_shortcodes($postexcerpt);
            echo evolve_truncate($postexcerpt, 180, ' [...]');
            ?>
 
</p>  
<a class="post-more" href="<?php 
            the_permalink();
            ?>
"><?php 
            _e('Read more', 'evolve');
            ?>
</a>    
</li>       

<?php 
        }
        ?>
 


<?php 
    } else {
        ?>
  
<li>
//.........这里部分代码省略.........
开发者ID:thejasonhsu,项目名称:Illumin,代码行数:101,代码来源:basic-functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP evt_add函数代码示例发布时间:2022-05-15
下一篇:
PHP evolve_get_option函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap