Esempio n. 1
0
function de_excerpt($excerpt, $content, $length = 0)
{
    if (strlen($excerpt)) {
        $length = $length == 0 ? strlen($excerpt) : $length;
        if (strlen($excerpt) > $length) {
            $result = mb_substr($excerpt, 0, $length, 'UTF-8');
            $result .= '...';
        } else {
            $result = $excerpt;
        }
    } else {
        $content = trim(strip_shortcodes($content));
        if (strlen($content) > strlen(strip_shortcodes($content))) {
            $length = $length == 0 ? strlen($content) : $length;
            $content = de_excerpt('', $content, $length);
        }
        $content = strip_tags($content);
        $length = $length == 0 ? strlen($content) : $length;
        if (strlen($content) > $length) {
            $result = mb_substr($content, 0, $length, 'UTF-8');
            $result .= '...';
        } else {
            $result = $content;
        }
    }
    return $result;
}
 </a>
									<?php 
            } else {
                // comments are closed
                ?>
										<a><?php 
                _e('Comments Off', 'cosmotheme');
                ?>
</a>
									<?php 
            }
            ?>
								</span>
								<p>
									<?php 
            echo de_excerpt($post->post_excerpt, $post->post_content, 100);
            ?>
								</p>
                                <?php 
            wp_link_pages();
            ?>
							</li>
						
						
		<?php 
        }
        /*EOF else*/
        ?>
				
						<?php 
        $post_number++;
Esempio n. 3
0
            ?>
						                        <a><?php 
            _e('Comments Off', 'cosmotheme');
            ?>
</a>
						                    <?php 
        }
        ?>
                                        
                                        </span>
                                        <p>
                                        <?php 
        if (strlen(strip_shortcodes($post->post_excerpt)) > 0) {
            the_excerpt();
        } else {
            echo de_excerpt('', $post->post_content, 400);
        }
        ?>
                                        </p>
                                        </li>
                                <?php 
    }
    ?>
                                </ul>

                                <?php 
    global $wp_rewrite;
    $paged > 1 ? $current = $paged : ($current = 1);
    $pagination = array('base' => @add_query_arg('paged', '%#%'), 'format' => '', 'total' => $posts->max_num_pages, 'current' => $current, 'show_all' => false, 'prev_next' => true, 'prev_text' => '&laquo;' . __('Previous', 'cosmotheme'), 'next_text' => __('Next', 'cosmotheme') . ' &raquo;', 'type' => 'array');
    if ($wp_rewrite->using_permalinks()) {
        $pagination['base'] = user_trailingslashit(trailingslashit(remove_query_arg('s', get_pagenum_link(1))) . 'page/%#%/', 'paged');