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

PHP get_the_posts_pagination函数代码示例

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

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



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

示例1: jbst4_page_navi

function jbst4_page_navi()
{
    // Previous/next page navigation.
    // replacement for the_posts_pagination
    // see: http://wordpress.stackexchange.com/questions/228185/is-using-the-posts-navigation-required
    echo str_replace(array('"next page-numbers"', '"previous page-numbers"'), array('"next page-numbers" aria-label="' . __('Next', 'jbst-4') . '"', '"previous page-numbers" aria-label="' . __('Previous', 'jbst-4') . '"'), get_the_posts_pagination(array('prev_text' => '<span aria-hidden="true">&laquo;</span><span class="sr-only">' . __('Previous', 'jbst-4') . '</span>', 'next_text' => '<span class="page-link" aria-hidden="true">&raquo;</span><span class="sr-only">' . __('Next', 'jbst-4') . '</span>', 'show_all' => true, 'before_page_number' => '<span class="page-link">', 'after_page_number' => '</span>', 'screen_reader_text' => __('Page navigation', 'jbst-4'))));
}
开发者ID:bassjobsen,项目名称:jbst-4-sass,代码行数:7,代码来源:page-navi.php


示例2: kt_paging_nav

 /**
  * Display navigation to next/previous set of posts when applicable.
  *
  * @since Boutique 1.0
  *
  * @global WP_Query   $wp_query   WordPress Query object.
  * @global WP_Rewrite $wp_rewrite WordPress Rewrite object.
  */
 function kt_paging_nav()
 {
     global $wp_query, $wp_rewrite;
     // Don't print empty markup if there's only one page.
     if ($wp_query->max_num_pages < 2) {
         return;
     }
     echo get_the_posts_pagination(array('prev_text' => '<i class="fa fa-long-arrow-left"></i>', 'next_text' => '<i class="fa fa-long-arrow-right"></i>', 'screen_reader_text' => '&nbsp;', 'before_page_number' => ''));
 }
开发者ID:TruongTuyen,项目名称:thuctapcoso,代码行数:17,代码来源:advance-functions.php


示例3: sociallyviral_post_navigation

    /**
     * Display navigation to next/previous post when applicable.
     *
     * @todo Remove this function when WordPress 4.3 is released.
     */
    function sociallyviral_post_navigation()
    {
        // Don't print empty markup if there's nowhere to navigate.
        // $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
        // $next     = get_adjacent_post( false, '', false );
        // if ( ! $next && ! $previous ) {
        // 	return;
        // }
        ?>
	<nav class="navigation posts-navigation" role="navigation">
		<!--Start Pagination-->
        <?php 
        $sociallyviral_nav_type = get_theme_mod('sociallyviral_pagination_position');
        if (!empty($sociallyviral_nav_type)) {
            $sociallyviral_pagination = get_the_posts_pagination(array('mid_size' => 2, 'prev_text' => __('Newer', 'sociallyviral'), 'next_text' => __('Older', 'sociallyviral')));
            echo $sociallyviral_pagination;
        } else {
            ?>
			<h2 class="screen-reader-text"><?php 
            _e('Posts navigation', 'sociallyviral');
            ?>
</h2>
			<div class="pagination nav-links">
				<?php 
            if (get_next_posts_link()) {
                ?>
					<div class="nav-previous"><?php 
                next_posts_link(__('<i class="demo-icon icon-angle-double-left"></i> Previous', 'sociallyviral'));
                ?>
</div>
				<?php 
            }
            ?>

				<?php 
            if (get_previous_posts_link()) {
                ?>
					<div class="nav-next"><?php 
                previous_posts_link(__('Next <i class="demo-icon icon-angle-double-right"></i>', 'sociallyviral'));
                ?>
</div>
				<?php 
            }
            ?>
			</div>
		<?php 
        }
        ?>
	</nav><!--End Pagination-->
	<?php 
    }
开发者ID:bigpopakap,项目名称:clickworthy,代码行数:56,代码来源:template-tags.php


示例4: carelib_get_posts_navigation

/**
 * Helper function to build a newer/older or paginated navigation element within
 * a loop of multiple entries. This takes care of all the annoying formatting
 * which usually would need to be done within a template.
 *
 * @since  1.0.0
 * @access public
 * @param  array $args An optional list of options.
 * @return string
 */
function carelib_get_posts_navigation($args = array())
{
    global $wp_query;
    // Return early if we're on a singular post or we only have one page.
    if (is_singular() || 1 === $wp_query->max_num_pages) {
        return;
    }
    $defaults = apply_filters("{$GLOBALS['carelib_prefix']}_posts_navigation_defaults", array('nav_type' => 'pagination', 'prev_link_text' => __('Newer Posts', 'carelib'), 'next_link_text' => __('Older Posts', 'carelib'), 'prev_text' => sprintf('<span class="screen-reader-text">%s</span>', __('Previous Page', 'carelib')), 'next_text' => sprintf('<span class="screen-reader-text">%s</span>', __('Next Page', 'carelib'))));
    $args = wp_parse_args($args, $defaults);
    if (function_exists('the_posts_pagination') && 'pagination' === $args['nav_type']) {
        $output = get_the_posts_pagination($args);
    } else {
        $output = '<nav ' . carelib_get_attr('nav', 'archive') . '>';
        $output .= sprintf('<span class="nav-previous">%s</span>', get_previous_posts_link($args['prev_link_text']));
        $output .= sprintf('<span class="nav-next">%s</span>', get_next_posts_link($args['next_link_text']));
        $output .= '</nav><!-- .nav-archive -->';
    }
    return apply_filters("{$GLOBALS['carelib_prefix']}_posts_navigation", $output, $args);
}
开发者ID:wpsitecare,项目名称:carelib,代码行数:29,代码来源:template-archive.php


示例5: wp_reset_postdata

} else {
    ?>
                
                <p>Oops! Looks like this on that day you didn't have any posts!... </p>
                
                <?php 
}
wp_reset_postdata();
?>
<!--
=== PAGINATION ===
-->
				<div id="pagination">

<?php 
$pagination = get_the_posts_pagination(array('mid_size' => 2, 'prev_text' => __('Back', 'newfangled'), 'next_text' => __('Onward', 'newfangled'), 'screen_reader_text' => __(' ')));
echo $pagination;
?>

				</div> <!--div#pagination ends-->
			</div>
			<div class="col-lg-4">
				<?php 
get_sidebar('blog');
?>
			</div>
		</div>
	</div>
	</section>

<?php 
开发者ID:shafi49,项目名称:newfangled-wp,代码行数:31,代码来源:archive.php


示例6: raindrops_the_pagenation

function raindrops_the_pagenation($html, $position)
{
    global $raindrops_document_type;
    if (function_exists('get_the_posts_pagination') && $position == 'nav-below') {
        if ($raindrops_document_type == 'html5') {
            $result = str_replace(array('role="navigation"'), array(''), get_the_posts_pagination());
            return $result;
        } elseif ($raindrops_document_type == 'xhtml') {
            $result = str_replace(array('<nav ', '</nav>'), array('<div ', '</div>'), get_the_posts_pagination());
            return $result;
        } else {
            return $html;
        }
    }
    return $html;
}
开发者ID:TheRojam,项目名称:raindrops,代码行数:16,代码来源:functions.php


示例7: shortcode_registries

 public function shortcode_registries()
 {
     $form_action = get_permalink();
     $page = get_query_var('paged') ? get_query_var('paged') : 1;
     $args = array('post_type' => array('as-registry'), 'post_status' => array('publish'), 'posts_per_page' => '20', 'order' => 'DESC', 'orderby' => 'date', 'cache_results' => true, 'paged' => $page);
     if (isset($_REQUEST['as-group']) && !empty($_REQUEST['as-group'])) {
         $group_id = $_REQUEST['as-group'];
         $args['tax_query'] = array(array('taxonomy' => 'as-group', 'terms' => $group_id));
     }
     $group_args = array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'hierarchical' => true, 'show_count' => 1, 'taxonomy' => 'as-group', 'echo' => 0, 'name' => 'as-group', 'selected' => $group_id, 'show_option_all' => __("Show All", "as-attendance"));
     $group_select = wp_dropdown_categories($group_args);
     if (isset($_REQUEST['registry_info_date']) && !empty($_REQUEST['registry_info_date'])) {
         $date = sanitize_text_field($_REQUEST['registry_info_date']);
         $args['meta_query'] = array('date' => array('relation' => 'AND', array('key' => 'registry_info_date', 'value' => $date, 'compare' => '=')));
     }
     if (isset($_REQUEST['registry_attendee']) && !empty($_REQUEST['registry_attendee'])) {
         $person = get_page_by_title($_REQUEST['registry_attendee'], 'OBJECT', 'as-person');
         if (!is_null($person)) {
             $args['meta_query'] = array('person' => array('relation' => 'AND', array('key' => 'registry_attendee_' . $person->ID)));
         }
     }
     $query = new WP_Query($args);
     global $wp_query;
     $temp_query = $wp_query;
     $wp_query = NULL;
     $wp_query = $query;
     $registries = array();
     if ($wp_query->have_posts()) {
         $pagination = get_the_posts_pagination(array('mid_size' => 2, 'prev_text' => __('Back', 'as-attendance'), 'next_text' => __('Onward', 'as-attendance')));
         while ($wp_query->have_posts()) {
             $wp_query->the_post();
             $groups = wp_get_object_terms(get_the_ID(), 'as-group');
             if (empty($person)) {
                 $attendees_ids = get_post_meta(get_the_ID(), 'registry_attendees_ids', true);
                 if (empty($attendees_ids)) {
                     echo '0/0';
                 } else {
                     $attendees = 0;
                     foreach ($attendees_ids as $id) {
                         $attendee = get_post_meta(get_the_ID(), 'registry_attendee_' . $id, true);
                         if (isset($attendee['present']) && $attendee['present'] == "1") {
                             $attendees++;
                         }
                     }
                     $percent = $attendees * 100 / count($attendees_ids);
                     $attendance = $attendees . '/' . count($attendees_ids) . ' (' . number_format($percent, 2) . '%)';
                 }
                 $annotation = get_post_meta(get_the_ID(), 'registry_info_annotation', true);
             } else {
                 $attendee_meta = get_post_meta(get_the_ID(), 'registry_attendee_' . $person->ID, true);
                 $present = $attendee_meta['present'] ? __('Yes', 'at-attendance') : __('No', 'at-attendance');
                 $annotation = $attendee_meta['annotation'];
             }
             $registries[] = array('ID' => get_the_ID(), 'title' => get_the_title(), 'groups' => $groups, 'annotation' => $annotation, 'link' => get_the_permalink(), 'attendance' => $attendance, 'present' => $present);
         }
     }
     $wp_query = NULL;
     $wp_query = $temp_query;
     wp_reset_postdata();
     require plugin_dir_path(__FILE__) . '../templates/list-registries.php';
 }
开发者ID:AtoomStudio,项目名称:Attendance,代码行数:61,代码来源:class-as-attendance-public.php


示例8: ewf_sc_blog_navigation_default

function ewf_sc_blog_navigation_default()
{
    return get_the_posts_pagination();
}
开发者ID:kadr,项目名称:semashko,代码行数:4,代码来源:functions-blog.php


示例9: wp_reset_postdata

         }
     }
     /** End loop divs, varies depending on the type of grid selected **/
     if ($i == $num_columns) {
         $item_string .= '</div></div><div class="fw-row basic-row">';
         $i = 0;
     } else {
         $item_string .= '</div>';
     }
     $i++;
 }
 echo $item_string;
 /** Restore original Post Data **/
 wp_reset_postdata();
 /** Custom query loop pagination **/
 $pagination = get_the_posts_pagination(array('mid_size' => 3, 'prev_text' => $prev_text, 'next_text' => $next_text));
 $prev_post = get_previous_posts_link();
 if (empty($prev_post)) {
     $greyed_prev = '<div class="prev page-numbers-faded" >' . $prev_text . '</div>';
 } else {
     $greyed_prev = '';
 }
 $next_post = get_next_posts_link();
 if (empty($next_post)) {
     $greyed_next = '<div class="next page-numbers-faded" >' . $next_text . '</div>';
 } else {
     $greyed_next = '';
 }
 /** Reset main query object **/
 $wp_query = NULL;
 $wp_query = $temp_query;
开发者ID:TheSaladFace,项目名称:Naked,代码行数:31,代码来源:view.php


示例10: everbox_posts_pagination

/**
 * Posts pagination
 */
function everbox_posts_pagination()
{
    $infinite = get_theme_mod('everbox_infinite', 0);
    if ($infinite) {
        return;
    }
    $output = '';
    $output .= '<div class="pagination-wrap">';
    $output .= get_the_posts_pagination(array('mid_size' => 1, 'screen_reader_text' => ''));
    $output .= '</div>';
    echo $output;
}
开发者ID:Hendaru,项目名称:wordpress,代码行数:15,代码来源:extras.php


示例11: loop_pagination

/**
 * Loop pagination function for paginating loops with multiple posts.  This should be used on archive, blog, and
 * search pages.  It is not for singular views.
 *
 * @since      loop-pagination-0.1.0
 * @deprecated 3.0.0
 * @access     public
 * @param      array   $args
 * @return     string
 */
function loop_pagination($args = array())
{
    _deprecated_function(__FUNCTION__, '3.0.0', 'the_posts_pagination()');
    return isset($args['echo']) && false === $args['echo'] ? get_the_posts_pagination($args) : the_posts_pagination($args);
}
开发者ID:KL-Kim,项目名称:my-theme,代码行数:15,代码来源:functions-deprecated.php


示例12: blog_pagination

function blog_pagination()
{
    $pagination = get_the_posts_pagination(array('mid_size' => 1, 'prev_text' => __('<span class="fa fa-chevron-left"></span>', 'textdomain'), 'next_text' => __('<span class="fa fa-chevron-right"></span>', 'textdomain'), 'screen_reader_text' => __(' ', 'textdomain')));
    echo $pagination;
}
开发者ID:DIESELOK,项目名称:GH-Frontend-5,代码行数:5,代码来源:functions.php


示例13: the_services

 /**
  * Display or return HTML-formatted services.
  *
  * @since  1.0.0
  * @param  string|array $args Arguments.
  * @return string
  */
 public function the_services($args = '')
 {
     /**
      * Filter the array of default arguments.
      *
      * @since 1.0.0
      * @param array Default arguments.
      * @param array The 'the_services' function argument.
      */
     $defaults = apply_filters('cherry_the_services_default_args', array('limit' => 3, 'orderby' => 'date', 'order' => 'DESC', 'id' => 0, 'categories' => '', 'show_photo' => true, 'show_name' => true, 'size' => 'thumbnail', 'echo' => true, 'columns' => 3, 'title' => '', 'excerpt_length' => 20, 'wrap_class' => 'cherry-services', 'before_title' => '<h2 class="cherry-services_title">', 'after_title' => '</h2>', 'pager' => false, 'layout' => 'boxed', 'button_text' => __('Read More', 'cherry-services'), 'order_button_text' => __('Order', 'cherry-services'), 'template' => 'default.tmpl', 'item_class' => 'cherry-services_item', 'col_xs' => '12', 'col_sm' => '12', 'col_md' => '12', 'col_lg' => '12', 'container' => '<div class="services-listing">%s</div>'), $args);
     $args = wp_parse_args($args, $defaults);
     /**
      * Filter the array of arguments.
      *
      * @since 1.0.0
      * @param array Arguments.
      */
     $args = apply_filters('cherry_the_services_args', $args);
     $output = '';
     /**
      * Fires before the services listing.
      *
      * @since 1.0.0
      * @param array $array The array of arguments.
      */
     do_action('cherry_services_before', $args);
     // The Query.
     $query = $this->get_services($args);
     global $wp_query;
     $this->temp_query = $wp_query;
     $wp_query = null;
     $wp_query = $query;
     // Fix boolean.
     if (isset($args['pager']) && ('true' == $args['pager'] || true === $args['pager'])) {
         $args['pager'] = true;
     } else {
         $args['pager'] = false;
     }
     // The Display.
     if (is_wp_error($query)) {
         return;
     }
     $css_class = '';
     if (!empty($args['wrap_class'])) {
         $css_class .= esc_attr($args['wrap_class']) . ' ';
     }
     if (!empty($args['class'])) {
         $css_class .= esc_attr($args['class']) . ' ';
     }
     $css_class .= esc_attr($args['layout']) . '-layout';
     // Open wrapper.
     $output .= sprintf('<div class="%s">', trim($css_class));
     if (!empty($args['title'])) {
         $output .= $args['before_title'] . $args['title'] . $args['after_title'];
     }
     $collapsed = 'pricing-table' == $args['layout'] ? ' collapse-row' : '';
     if (false !== $args['columns']) {
         $output .= '<div class="row' . $collapsed . '">';
     }
     if (false !== $args['container']) {
         $output .= sprintf($args['container'], $this->get_services_loop($query, $args));
     } else {
         $output .= $this->get_services_loop($query, $args);
     }
     if (false !== $args['columns']) {
         $output .= '</div>';
     }
     // Close wrapper.
     $output .= '</div>';
     if (true == $args['pager']) {
         $output .= get_the_posts_pagination();
     }
     $wp_query = null;
     $wp_query = $this->temp_query;
     /**
      * Filters HTML-formatted services before display or return.
      *
      * @since 1.0.0
      * @param string $output The HTML-formatted services.
      * @param array  $query  List of WP_Post objects.
      * @param array  $args   The array of arguments.
      */
     $output = apply_filters('cherry_services_html', $output, $query, $args);
     wp_reset_query();
     wp_reset_postdata();
     if (true !== $args['echo']) {
         return $output;
     }
     // If "echo" is set to true.
     echo $output;
     /**
      * Fires after the services listing.
      *
//.........这里部分代码省略.........
开发者ID:xav335,项目名称:sfnettoyage,代码行数:101,代码来源:class-cherry-services-data.php


示例14: vc_portfolio


//.........这里部分代码省略.........
            if (rwmb_meta('us_title_bg_color') != '') {
                $anchor_css .= ' background-color: ' . rwmb_meta('us_title_bg_color') . ';';
            }
            if (rwmb_meta('us_title_text_color') != '') {
                $anchor_css .= ' color: ' . rwmb_meta('us_title_text_color') . ';';
            }
            if ($anchor_css != '') {
                $anchor_css = ' style="' . $anchor_css . '"';
            }
            $output .= '<div class="w-portfolio-item order_' . $portfolio_order_counter . $item_categories_classes . ' animate_reveal">
							<div class="w-portfolio-item-h">
								<a class="w-portfolio-item-anchor"' . $link_target . $link_ref . ' href="' . $link . '"' . $anchor_css . '>
									<div class="w-portfolio-item-image">';
            if (has_post_thumbnail()) {
                $output .= get_the_post_thumbnail(null, 'portfolio-list-' . $attributes['ratio'], array('class' => 'w-portfolio-item-image-first'));
            } else {
                $output .= '<img class="w-portfolio-item-image-first" src="' . get_template_directory_uri() . '/img/placeholder/500x500.gif" alt="">';
            }
            $output .= '	</div>
									<div class="w-portfolio-item-meta">
										<div class="w-portfolio-item-meta-h">
											<h2 class="w-portfolio-item-title">' . the_title('', '', FALSE) . '</h2>
											<span class="w-portfolio-item-arrow"></span>
											<span class="w-portfolio-item-text">' . $meta_html . '</span>
										</div>
									</div>
								</a>
							</div>
						</div>';
        }
        $output .= '</div>';
        if ($attributes['pagination'] == 1 or $attributes['pagination'] == 'yes' or $attributes['pagination'] == 'regular') {
            $output .= '<div class="w-portfolio-pagination">
					' . get_the_posts_pagination(array('prev_text' => '<', 'next_text' => '>', 'before_page_number' => '<span>', 'after_page_number' => '</span>')) . '
			</div>';
        } elseif ($attributes['pagination'] == 'ajax') {
            $max_num_pages = $wp_query->max_num_pages;
            if ($max_num_pages > 1) {
                $output .= '<div class="w-loadmore" id="us_load_more_' . $rand_id . '">
								<a href="javascript:void(0);" id="grid_load_more" class="g-btn color_primary type_flat size_big"><span>' . __('Load More Items', 'us') . '</span></a>
								<div class="w-preloader type_2"></div>
							</div>';
                $output .= '<script type="text/javascript">
							var page = 1,
								max_page = ' . $max_num_pages . ';
							jQuery(document).ready(function(){
								jQuery("#us_load_more_' . $rand_id . ' .g-btn").click(function(){
									jQuery("#us_load_more_' . $rand_id . '").addClass("loading");
									jQuery.ajax({
										type: "POST",
										url: "' . admin_url("admin-ajax.php") . '",
										data: {
											action: "portfolioAjaxPagination",
											columns: "' . $attributes['columns'] . '",
											items: "' . $attributes['items'] . '",
											style: "' . $attributes['style'] . '",
											align: "' . $attributes['align'] . '",
											ratio: "' . $attributes['ratio'] . '",
											with_indents: "' . $attributes['with_indents'] . '",
											meta: "' . $attributes['meta'] . '",
											filters: "' . $attributes['filters'] . '",
											category: "' . $attributes['category'] . '",
											page: page+1
										},
										success: function(data, textStatus, XMLHttpRequest){
											page++;
开发者ID:ConceptHaus,项目名称:atra,代码行数:67,代码来源:shortcodes.php


示例15: cacsp_pagination

/**
 * Template tag to output pagination on archive page.
 *
 * Pagination resembles the markup from BuddyPress.
 */
function cacsp_pagination($type = 'top')
{
    // no pagination? bail!
    if ('' === get_the_posts_pagination()) {
        return;
    }
    $pag_args = array('prev_text' => _x('&larr;', 'Pagination previous text', 'social-paper'), 'next_text' => _x('&rarr;', 'Pagination next text', 'social-paper'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'social-paper') . ' </span>');
    if (defined('DOING_AJAX') && true === DOING_AJAX) {
        add_filter('get_pagenum_link', create_function('', "\n\t\t\treturn trailingslashit( get_post_type_archive_link( 'cacsp_paper' ) );\n\t\t"));
        $pag_args['format'] = '';
        $pag_args['base'] = trailingslashit(get_post_type_archive_link('cacsp_paper')) . 'page/%#%/';
        if (!empty($_POST['search_terms'])) {
            $pag_args['base'] .= '?s=' . esc_attr($_POST['search_terms']);
        }
        if (!empty($_POST['scope']) && 'personal' === $_POST['scope'] && is_user_logged_in()) {
            if (!empty($_POST['search_terms'])) {
                $pag_args['base'] .= '&';
            } else {
                $pag_args['base'] .= '?';
            }
            $pag_args['base'] .= 'user=' . bp_loggedin_user_id();
        }
    }
    ?>

	<div id="pag-<?php 
    esc_attr_e($type);
    ?>
" class="pagination no-ajax">
		<div class="pag-count">
			<?php 
    if (1 === (int) $GLOBALS['wp_query']->found_posts) {
        _e('Viewing 1 paper', 'social-paper');
    } else {
        $curr_page = get_query_var('paged') ? get_query_var('paged') : 1;
        $start_num = intval(($curr_page - 1) * get_query_var('posts_per_page')) + 1;
        $to_num = $start_num + (get_query_var('posts_per_page') - 1) > $GLOBALS['wp_query']->found_posts ? $GLOBALS['wp_query']->found_posts : $start_num + (get_query_var('posts_per_page') - 1);
        printf(_n('Viewing %1$s - %2$s of %3$s paper', 'Viewing %1$s - %2$s of %3$s papers', (int) $GLOBALS['wp_query']->found_posts, 'social-paper'), number_format_i18n($start_num), number_format_i18n($to_num), number_format_i18n($GLOBALS['wp_query']->found_posts));
    }
    ?>
		</div>

		<div class="pagination-links">
			<?php 
    echo paginate_links($pag_args);
    ?>
		</div>
	</div>

<?php 
}
开发者ID:sheesh,项目名称:social-paper,代码行数:56,代码来源:functions.php


示例16: generateContent


//.........这里部分代码省略.........
         while (have_posts()) {
             the_post();
             $postContent = $heading = $meta = $machineMeta = $postDomType = "";
             // Configuring content for different post types
             if (get_post_type() != false) {
                 switch (get_post_type()) {
                     case "post":
                         $postDomType = $settings['post_dom_type'];
                         // Constructing post meta
                         if ($settings['post_meta_date']) {
                             $meta .= get_the_date();
                             $machineMeta .= get_the_date("Y-m-d");
                             if ($settings['post_meta_time']) {
                                 $meta .= ", ";
                                 $machineMeta .= " ";
                             }
                         }
                         if ($settings['post_meta_time']) {
                             $meta .= get_the_time();
                         }
                         if ($settings['post_title']) {
                             $heading = "<h" . $settings['post_heading_level'] . ">" . get_the_title() . "</h" . $settings['post_heading_level'] . ">";
                         }
                         break;
                     case "page":
                         $postDomType = $settings['page_dom_type'];
                         if ($settings['page_meta_date']) {
                             $meta .= get_the_date();
                             $machineMeta .= get_the_date("Y-m-d");
                             if ($settings['page_meta_time']) {
                                 $meta .= ", ";
                                 $machineMeta .= " ";
                             }
                         }
                         if ($settings['page_meta_time']) {
                             $meta .= get_the_time();
                             $machineMeta .= get_the_time("H:i");
                         }
                         if ($settings['page_title']) {
                             $heading = "<h" . $settings['page_heading_level'] . ">" . get_the_title() . "</h" . $settings['page_heading_level'] . ">";
                         }
                 }
             }
             if (!empty($meta)) {
                 $postContent .= "<time datetime=\"" . $machineMeta . "\" class=\"article-meta\">" . $meta . "</time>";
             }
             if (!empty($heading)) {
                 $postContent = "<" . $settings['header_dom_type'] . ">" . $heading . $postContent . "</" . $settings['header_dom_type'] . ">";
             }
             if ((current_user_can('editor') || current_user_can('administrator')) && get_post_type() == "post") {
                 if ($settings["post_admin"] && get_post_type() == "post" || $settings["page_admin"] && get_post_type() == "page") {
                     $postContent .= "<footer>\n                                            <ul>\n                                                <li><a href=\"" . get_edit_post_link() . "\">" . __('Edit', 'ease') . "</a></li>\n                                                <li><a href=\"" . get_delete_post_link() . "\">" . __('Delete', 'ease') . "</a></li>";
                     if ($settings["post_admin_author"] && get_post_type() == "post" || $settings["page_admin_author"] && get_post_type() == "page") {
                         $postContent .= "<li>" . __('Author', 'ease') . ": " . get_the_author() . "</li>";
                     }
                     $postContent .= "</ul>\n                                        </footer>";
                 }
             }
             switch (get_post_type()) {
                 case "post":
                     if (!$settings['post_autoparagraph']) {
                         remove_filter('the_content', 'wpautop');
                     }
                     break;
                 case "page":
                     if (!$settings['page_autoparagraph']) {
                         remove_filter('the_content', 'wpautop');
                     }
                     break;
             }
             ob_start();
             the_content();
             $postContentHandler = ob_get_clean();
             if (!empty($settings['post_content_wrapper_dom_type'])) {
                 $dom = "<" . $settings['post_content_wrapper_dom_type'];
                 if (!empty($settings['post_content_wrapper_class'])) {
                     $dom .= " class=\"" . $settings['post_content_wrapper_class'] . "\"";
                 }
                 $dom .= ">";
                 $postContentHandler = $dom . $postContentHandler . "</" . $settings['post_content_wrapper_dom_type'] . ">";
             }
             $postContent .= $postContentHandler;
             if ((current_user_can('editor') || current_user_can('administrator')) && get_post_type() == "page") {
                 if ($settings["post_admin"] && get_post_type() == "post" || $settings["page_admin"] && get_post_type() == "page") {
                     $postContent .= "<footer>\n                                            <ul>\n                                                <li><a href=\"" . get_edit_post_link() . "\">" . __('Edit', 'ease') . "</a></li>\n                                                <li><a href=\"" . get_delete_post_link() . "\">" . __('Delete', 'ease') . "</a></li>";
                     if ($settings["post_admin_author"] && get_post_type() == "post" || $settings["page_admin_author"] && get_post_type() == "page") {
                         $postContent .= "<li>" . __('Author', 'ease') . ": " . get_the_author() . "</li>";
                     }
                     $postContent .= "</ul>\n                                        </footer>";
                 }
             }
             if (!empty($postDomType)) {
                 $postContent = "<" . $postDomType . ">" . $postContent . "</" . $postDomType . ">";
             }
             $content .= $postContent;
         }
         $content .= get_the_posts_pagination(array('prev_text' => 'Previous Page', 'next_text' => 'Next Page', 'before_page_number' => '<span class="meta-nav screen-reader-text">Page </span>'));
     }
     return $content;
 }
开发者ID:TheCodePianist,项目名称:ease,代码行数:101,代码来源:ease.php


示例17: kt_paging_nav

 /**
  * Display navigation to next/previous set of posts when applicable.
  *
  * @since Twenty Fourteen 1.0
  *
  * @global WP_Query   $wp_query   WordPress Query object.
  * @global WP_Rewrite $wp_rewrite WordPress Rewrite object.
  */
 function kt_paging_nav()
 {
     global $wp_query, $wp_rewrite;
     // Don't print empty markup if there's only one page.
     if ($wp_query->max_num_pages < 2) {
         return;
     }
     echo get_the_posts_pagination(array('prev_text' => sprintf('<i class="fa fa-angle-double-left"></i> %1$s', esc_attr__('Назад', 'kutetheme')), 'next_text' => sprintf('%1$s <i class="fa fa-angle-double-right"></i>', esc_attr__('Вперед', 'kutetheme')), 'screen_reader_text' => '&nbsp;', 'before_page_number' => ''));
 }
开发者ID:hikaram,项目名称:wee,代码行数:17,代码来源:utility.php


示例18: the_posts_pagination

 /**
  * Display a paginated navigation to next/previous set of posts,
  * when applicable.
  *
  * @todo Remove this function when WordPress 4.3 is released.
  *
  * @param array $args Optional. See {@see get_the_posts_pagination()} for available arguments.
  *                    Default empty array.
  */
 function the_posts_pagination($args = array())
 {
     echo balanceTags(get_the_posts_pagination($args));
 }
开发者ID:henrikauppinen,项目名称:lpk15-website-wp,代码行数:13,代码来源:template-tags.php


示例19: the_team

 /**
  * Display or return HTML-formatted team.
  *
  * @since  1.0.0
  * @param  string|array $args Arguments.
  * @return string
  */
 public function the_team($args = '')
 {
     /**
      * Filter the array of default arguments.
      *
      * @since 1.0.0
      * @param array Default arguments.
      * @param array The 'the_team' function argument.
      */
     $defaults = apply_filters('cherry_the_team_default_args', array('limit' => 3, 'orderby' => 'date', 'order' => 'DESC', 'group' => '', 'id' => 0, 'show_photo' => true, 'show_name' => true, 'size' => 'thumbnail', 'echo' => true, 'title' => '', 'excerpt_length' => 20, 'wrap_class' => 'team-wrap', 'col_xs' => false, 'col_sm' => false, 'col_md' => false, 'col_lg' => false, 'before_title' => '<h2>', 'after_title' => '</h2>', 'pager' => false, 'template' => 'default.tmpl', 'item_class' => 'team-item', 'container' => '<div class="team-listing row">%s</div>'), $args);
     $args = wp_parse_args($args, $defaults);
     /**
      * Filter the array of arguments.
      *
      * @since 1.0.0
      * @param array Arguments.
      */
     $args = apply_filters('cherry_the_team_args', $args);
     $output = '';
     /**
      * Fires before the team listing.
      *
      * @since 1.0.0
      * @param array $array The array of arguments.
      */
     do_action('cherry_team_before', $args);
     // The Query.
     $query = $this->get_team($args);
     global $wp_query;
     $this->temp_query = $wp_query;
     $wp_query = NULL;
     $wp_query = $query;
     // Fix boolean.
     if (isset($args['pager']) && ('true' == $args['pager'] || true === $args['pager'])) {
         $args['pager'] = true;
     } else {
         $args['pager'] = false;
     }
     // The Display.
     if (is_wp_error($query)) {
         return;
     }
     $css_class = '';
     if (!empty($args['wrap_class'])) {
         $css_class .= esc_attr($args['wrap_class']) . ' ';
     }
     if (!empty($args['class'])) {
         $css_class .= esc_attr($args['class']);
     }
     // Open wrapper.
     $output .= sprintf('<div class="%s">', trim($css_class));
     if (!empty($args['title'])) {
         $output .= $args['before_title'] . $args['title'] . $args['after_title'];
     }
     if (false !== $args['container']) {
         $output .= sprintf($args['container'], $this->get_team_loop($query, $args));
     } else {
         $output .= $this->get_team_loop($query, $args);
     }
     // Close wrapper.
     $output .= '</div>';
     if (true == $args['pager']) {
         $output .= get_the_posts_pagination();
     }
     $wp_query = NULL;
     $wp_query = $this->temp_query;
     /**
      * Filters HTML-formatted team before display or return.
      *
      * @since 1.0.0
      * @param string $output The HTML-formatted team.
      * @param array  $query  List of WP_Post objects.
      * @param array  $args   The array of arguments.
      */
     $output = apply_filters('cherry_team_html', $output, $query, $args);
     wp_reset_query();
     wp_reset_postdata();
     if ($args['echo'] != true) {
         return $output;
     }
     // If "echo" is set to true.
     echo $output;
     /**
      * Fires after the team listing.
      *
      * This hook fires only when "echo" is set to true.
      *
      * @since 1.0.0
      * @param array $array The array of arguments.
      */
     do_action('cherry_team_after', $args);
 }
开发者ID:roberto-alarcon,项目名称:Neuroglobal,代码行数:99,代码来源:class-cherry-team-data.php


示例20: getFunctions


//.........这里部分代码省略.........
     // post_password_required
     $funcs[] = new Twig_SimpleFunction('post_password_required', function () {
         return post_password_required();
     }, $html_safe);
     // the_title
     $funcs[] = new Twig_SimpleFunction('the_title', f 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_the_tag_list函数代码示例发布时间:2022-05-15
下一篇:
PHP get_the_post_thumbnail_url函数代码示例发布时间: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