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


PHP wp_page_numbers函数代码示例

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


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

示例1: catchbox_content_nav

/**
 * Display navigation to next/previous pages when applicable
 */
function catchbox_content_nav( $nav_id ) {
	global $wp_query;
		
	if ( $wp_query->max_num_pages > 1 ) { ?>
		<nav id="<?php echo $nav_id; ?>">
        	<h3 class="assistive-text"><?php _e( 'Post navigation', 'catchbox' ); ?></h3>
			<?php if ( function_exists('wp_pagenavi' ) )  { 
                wp_pagenavi();
            }
            elseif ( function_exists('wp_page_numbers' ) ) { 
                wp_page_numbers();
            }
            else { ?>	
            	<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'catchbox' ) ); ?></div>
                <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'catchbox' ) ); ?></div>
            <?php 
            } ?>
		</nav><!-- #nav -->
	<?php 
	}
}
开发者ID:ramo01,项目名称:1kapp,代码行数:24,代码来源:functions.php

示例2: theme_page_navigation

    function theme_page_navigation($args = '')
    {
        $args = wp_parse_args($args, array('wrap' => true, 'prev_link' => false, 'next_link' => false));
        $prev_link = $args['prev_link'];
        $next_link = $args['next_link'];
        $wrap = $args['wrap'];
        if (!$prev_link && !$next_link) {
            if (function_exists('wp_page_numbers')) {
                // http://wordpress.org/extend/plugins/wp-page-numbers/
                ob_start();
                wp_page_numbers();
                theme_post_wrapper(array('content' => ob_get_clean()));
                return;
            }
            if (function_exists('wp_pagenavi')) {
                // http://wordpress.org/extend/plugins/wp-pagenavi/
                ob_start();
                wp_pagenavi();
                theme_post_wrapper(array('content' => ob_get_clean()));
                return;
            }
            //posts
            $prev_link = get_previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', THEME_NS));
            $next_link = get_next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', THEME_NS));
        }
        $content = '';
        if ($prev_link || $next_link) {
            $content = <<<EOL
\t<div class="navigation">
\t\t<div class="alignleft">{$next_link}</div>
\t\t<div class="alignright">{$prev_link}</div>
\t </div>
EOL;
        }
        if ($wrap) {
            theme_post_wrapper(array('content' => $content));
        } else {
            echo $content;
        }
    }
开发者ID:bexandy,项目名称:ninacleaning,代码行数:40,代码来源:functions.php

示例3: wp_tag_cloud

			<?php 
    wp_tag_cloud('smallest=9&largest=22&unit=pt&number=200&format=flat&orderby=name&order=ASC');
    ?>
		</div>
	</div>

	<?php 
}
?>

<?php 
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1) {
    if (function_exists('wp_page_numbers')) {
        wp_page_numbers();
    } elseif (function_exists('wp_pagenavi')) {
        wp_pagenavi();
    } else {
        echo '<div id="pagination">';
        posts_nav_link(' ', __('<span class="pagination_prev">&laquo; Previous page</span>', 'simplelove'), __('<span class="pagination_next">Next page &raquo;</span>', 'simplelove'));
        echo '</div>';
    }
} else {
    echo '<div id="pagination" class="pagination">';
    echo '<a href="/">' . __('Home', 'simplelove') . '</a>';
    echo '</div>';
}
?>

</div>
开发者ID:normalhh,项目名称:zwwtheme.old,代码行数:31,代码来源:archive.php

示例4: catchevolution_content_nav

    /**
     * Display navigation to next/previous pages when applicable
     */
    function catchevolution_content_nav($nav_id)
    {
        global $wp_query;
        /**
         * Check Jetpack Infinite Scroll
         * if it's active then disable pagination
         */
        if (class_exists('Jetpack', false)) {
            $jetpack_active_modules = get_option('jetpack_active_modules');
            if ($jetpack_active_modules && in_array('infinite-scroll', $jetpack_active_modules)) {
                return false;
            }
        }
        $nav_class = 'site-navigation paging-navigation';
        if (is_single()) {
            $nav_class = 'site-navigation post-navigation';
        }
        if ($wp_query->max_num_pages > 1) {
            ?>
        <nav role="navigation" id="<?php 
            echo $nav_id;
            ?>
">
        	<h3 class="assistive-text"><?php 
            _e('Post navigation', 'catch-evolution');
            ?>
</h3>
			<?php 
            if (function_exists('wp_pagenavi')) {
                wp_pagenavi();
            } elseif (function_exists('wp_page_numbers')) {
                wp_page_numbers();
            } else {
                ?>
	
                <div class="nav-previous"><?php 
                next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', 'catch-evolution'));
                ?>
</div>
                <div class="nav-next"><?php 
                previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', 'catch-evolution'));
                ?>
</div>
            <?php 
            }
            ?>
        </nav><!-- #nav -->	
	<?php 
        }
    }
开发者ID:jrialland,项目名称:site-plr,代码行数:53,代码来源:catchevolution-functions.php

示例5: widget_navigation_bottom

function widget_navigation_bottom($args)
{
    if (is_single() || is_page()) {
        return;
    }
    ?>
			<div id="nav-below" class="navigation">
                <?php 
    if (function_exists('wp_pagenavi')) {
        wp_pagenavi();
    } elseif (function_exists('wp_page_numbers')) {
        wp_page_numbers();
    } else {
        ?>
  
				<div class="nav-previous"><?php 
        next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'thematic'));
        ?>
</div>
				<div class="nav-next"><?php 
        previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'thematic'));
        ?>
</div>
				<?php 
    }
    ?>
			</div>
<?php 
}
开发者ID:alicam,项目名称:vanilla-theme,代码行数:29,代码来源:widgets.php

示例6: simplecatch_content_nav

    /**
     * Display navigation to next/previous pages when applicable
     *
     * @since Catch Everest 1.0
     */
    function simplecatch_content_nav($nav_id)
    {
        global $wp_query, $post;
        /**
         * Check Jetpack Infinite Scroll
         * if it's active then disable pagination
         */
        if (class_exists('Jetpack', false)) {
            $jetpack_active_modules = get_option('jetpack_active_modules');
            if ($jetpack_active_modules && in_array('infinite-scroll', $jetpack_active_modules)) {
                return false;
            }
        }
        // Checking WP Page Numbers plugin exist
        if (function_exists('wp_pagenavi')) {
            wp_pagenavi();
            // Checking WP-PageNaviplugin exist
        } elseif (function_exists('wp_page_numbers')) {
            wp_page_numbers();
        } else {
            if ($wp_query->max_num_pages > 1) {
                ?>
			<ul class="default-wp-page">
				<li class="previous"><?php 
                next_posts_link(__('Previous', 'simple-catch'));
                ?>
</li>
				<li class="next"><?php 
                previous_posts_link(__('Next', 'simple-catch'));
                ?>
</li>
			</ul>
		<?php 
            }
        }
    }
开发者ID:karthikakamalanathan,项目名称:wp-cookieLawInfo,代码行数:41,代码来源:simplecatch_functions.php

示例7: catchkathmandu_content_query_nav

    /**
     * Display navigation to next/previous pages for custom query
     *
     * @since Catch Kathmandu 1.0
     */
    function catchkathmandu_content_query_nav($nav_id)
    {
        global $wp_query, $post;
        // Don't print empty markup on single pages if there's nowhere to navigate.
        if (is_single()) {
            $previous = is_attachment() ? get_post($post->post_parent) : get_adjacent_post(false, '', true);
            $next = get_adjacent_post(false, '', false);
            if (!$next && !$previous) {
                return;
            }
        }
        // Don't print empty markup in archives if there's only one page.
        if ($wp_query->max_num_pages < 2 && (is_home() || is_archive() || is_search())) {
            return;
        }
        $nav_class = 'site-navigation paging-navigation';
        if (is_single()) {
            $nav_class = 'site-navigation post-navigation';
        }
        ?>
	<nav role="navigation" id="<?php 
        echo $nav_id;
        ?>
" class="<?php 
        echo $nav_class;
        ?>
">
		<h1 class="assistive-text"><?php 
        _e('Post navigation', 'catch-kathmandu');
        ?>
</h1>

	<?php 
        if (is_single()) {
            // navigation links for single posts
            ?>

		<?php 
            previous_post_link('<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x('&larr;', 'Previous post link', 'catch-kathmandu') . '</span> %title');
            ?>
		<?php 
            next_post_link('<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x('&rarr;', 'Next post link', 'catch-kathmandu') . '</span>');
            ?>

	<?php 
        } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) {
            // navigation links for home, archive, and search pages
            ?>

		<?php 
            if (function_exists('wp_pagenavi')) {
                wp_pagenavi();
            } elseif (function_exists('wp_page_numbers')) {
                wp_page_numbers();
            } else {
                ?>
			<?php 
                if (get_next_posts_link()) {
                    ?>
			<div class="nav-previous"><?php 
                    next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', 'catch-kathmandu'));
                    ?>
</div>
			<?php 
                }
                ?>

			<?php 
                if (get_previous_posts_link()) {
                    ?>
            <div class="nav-next"><?php 
                    previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', 'catch-kathmandu'));
                    ?>
</div>
            <?php 
                }
                ?>
       	<?php 
            }
            ?>

	<?php 
        }
        ?>

	</nav><!-- #<?php 
        echo $nav_id;
        ?>
 -->
	<?php 
    }
开发者ID:jaironman3008,项目名称:rctgrigota2015,代码行数:96,代码来源:template-tags.php


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