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


PHP wp_pagenavi函数代码示例

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


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

示例1: gallery_nav_below

function gallery_nav_below()
{
    if (!is_single()) {
        ?>

			<div id="nav-below" class="navigation">
                <?php 
        if (function_exists('wp_pagenavi')) {
            ?>
                <?php 
            wp_pagenavi();
            ?>
                <?php 
        } 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:Aliciakwan,项目名称:OneCollection,代码行数:32,代码来源:functions.php

示例2: getpagenavi

function getpagenavi()
{
    ?>
    <div id="navigation" class="clearfix">
        <?php 
    if (function_exists('wp_pagenavi')) {
        ?>
            <?php 
        wp_pagenavi();
        ?>
        <?php 
    } else {
        ?>
            <div class="alignleft"><?php 
        next_posts_link(__('&laquo; Older Entries', 'web2feeel'));
        ?>
</div>
            <div class="alignright"><?php 
        previous_posts_link(__('Newer Entries &raquo;', 'web2feel'));
        ?>
</div>
            <div class="clear"></div>
        <?php 
    }
    ?>

    </div>

    <?php 
}
开发者ID:netfor,项目名称:nextrading,代码行数:30,代码来源:functions.php

示例3: nice_pagenavi

    function nice_pagenavi()
    {
        if (function_exists('wp_pagenavi')) {
            wp_pagenavi();
        } else {
            ?>

			<?php 
            if (get_next_posts_link() || get_previous_posts_link()) {
                ?>

	            <nav class="nav-entries">
	                <?php 
                next_posts_link('<div class="nav-prev fl">' . __('Older posts', 'nicethemes') . '</div>');
                ?>
	                <?php 
                previous_posts_link('<div class="nav-next fr">' . __('Newer posts', 'nicethemes') . '</div>');
                ?>
	                <div class="fix"></div>
	            </nav>

			<?php 
            }
            ?>

		<?php 
        }
    }
开发者ID:scottbrabazon,项目名称:scottbrabazon.com,代码行数:28,代码来源:functions.php

示例4: webonary_zeedisplay_page_navigation

/**
 * Common page navigation
 */
function webonary_zeedisplay_page_navigation()
{
    if (function_exists('wp_pagenavi')) {
        // if PageNavi is activated
        ?>
		<div class="more_posts">
			<?php 
        wp_pagenavi();
        // Use PageNavi
        ?>
		</div>
	<?php 
    } else {
        // Otherwise, use traditional Navigation
        ?>
		<div class="more_posts">
			<span class="post_links">
				<?php 
        previous_posts_link(__('&laquo; Previous Entries', ZEE_LANG));
        ?>
				<?php 
        next_posts_link(__('Next Entries &raquo;', ZEE_LANG)) & nbsp;
        ?>
			</span>
		</div>
	<?php 
    }
}
开发者ID:rick-maclean,项目名称:webonaryLinuxCopy,代码行数:31,代码来源:navigation.php

示例5: agency_navigation

function agency_navigation($type = 'plain', $endsize = 1, $midsize = 1)
{
    echo '  <div class="paging clearfix">' . "\n";
    if (function_exists('wp_pagenavi')) {
        ?>

    <?php 
        wp_pagenavi();
        ?>

  <?php 
    } else {
        global $wp_query, $wp_rewrite;
        $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : ($current = 1);
        // Sanitize input argument values
        if (!in_array($type, array('plain', 'list', 'array'))) {
            $type = 'plain';
        }
        $endsize = (int) $endsize;
        $midsize = (int) $midsize;
        // Setup argument array for paginate_links()
        $pagination = array('base' => @add_query_arg('paged', '%#%'), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => false, 'end_size' => $endsize, 'mid_size' => $midsize, 'type' => $type, 'prev_text' => __('&larr; Previous', 'agency'), 'next_text' => __('Next &rarr;', 'agency'));
        if ($wp_rewrite->using_permalinks()) {
            $pagination['base'] = user_trailingslashit(trailingslashit(remove_query_arg('s', get_pagenum_link(1))) . 'page/%#%/', 'paged');
        }
        if (!empty($wp_query->query_vars['s'])) {
            $pagination['add_args'] = array('s' => get_query_var('s'));
        }
        echo "<p><strong>" . paginate_links($pagination) . "</strong></p>";
    }
    echo '  </div>' . "\n";
}
开发者ID:kamleshcropin,项目名称:Agency-Theme,代码行数:32,代码来源:utility-functions.php

示例6: section_template

    function section_template()
    {
        ?>
		<?php 
        if (function_exists('wp_pagenavi') && show_posts_nav() && VPRO) {
            ?>
 
			<?php 
            wp_pagenavi();
            ?>
  
		<?php 
        } elseif (show_posts_nav()) {
            ?>
			<div class="page-nav-default fix">
				<span class="previous-entries"><?php 
            next_posts_link(__('&larr; Previous Entries', 'pagelines'));
            ?>
</span>
				<span class="next-entries"><?php 
            previous_posts_link(__('Next Entries &rarr;', 'pagelines'));
            ?>
</span>
			</div><!-- page nav -->
		<?php 
        }
        ?>
		
	<?php 
    }
开发者ID:rohans,项目名称:tradeinbooks,代码行数:30,代码来源:section.pagination.php

示例7: comicpress_pagination

function comicpress_pagination()
{
    global $post, $wp_query;
    if (function_exists('wp_pagenavi')) {
        ?>
		<?php 
        wp_pagenavi('<div id="wp-paginav">', '<div class="clear"></div></div>');
        ?>
	<?php 
    } else {
        ?>
		<div id="pagenav">
		<div class="pagenav-right"><?php 
        previous_posts_link(__('Newer Entries &uarr;', 'comicpress'));
        ?>
</div>
		<div class="pagenav-left"><?php 
        next_posts_link(__('&darr; Previous Entries', 'comicpress'));
        ?>
</div>
		<div class="clear"></div>
		</div>
	<?php 
    }
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:25,代码来源:pagination.php

示例8: ProjectTheme_my_account_completed_projects_area_function

function ProjectTheme_my_account_completed_projects_area_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="account-main-area">
        
        
         
				
                
                <?php 
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    global $wp_query, $wpdb;
    $query_vars = $wp_query->query_vars;
    $post_per_page = 10;
    $querystr = "\n                        SELECT p.ID \n                        FROM {$wpdb->posts} AS p\n                        LEFT JOIN {$wpdb->prefix}project_bids AS pb ON p.ID = pb.pid\n                        WHERE   p.post_author = '{$uid}'\n                            AND pb.winner = '1'\n                            AND pb.paid = '1'\n                            AND p.post_type = 'project' ";
    $pageposts = $wpdb->get_col($querystr);
    if (empty($pageposts)) {
        echo '<div class="my_box3 border_bottom_0"> <div class="box_content">   ';
        _e("There are no completed projects yet.", 'ProjectTheme');
        echo '</div>  </div> ';
    } else {
        //				$paid = array(
        //						'key' => 'paid_user',
        //						'value' => "1",
        //						'compare' => '='
        //					);
        //
        //				$args = array('post_type' => 'project','author' => $uid, 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page,
        //				'paged' => $query_vars['paged'], 'meta_query' => array($paid));
        $args = array('post_type' => 'project', 'author' => $uid, 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => $query_vars['paged'], 'post__in' => $pageposts);
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_paid();
            }
            if (function_exists('wp_pagenavi')) {
                wp_pagenavi();
            }
        } else {
            echo '<div class="my_box3 border_bottom_0"> <div class="box_content">   ';
            _e("There are no completed projects yet.", 'ProjectTheme');
            echo '</div>  </div> ';
        }
        wp_reset_query();
    }
    ?>
        
   
        
  		</div>      
<?php 
    ProjectTheme_get_users_links();
}
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:59,代码来源:completed_projects.php

示例9: ProjectTheme_my_account_bid_projects_area_function

function ProjectTheme_my_account_bid_projects_area_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="account-main-area">
 

                <?php 
    global $wp_query;
    $query_vars = $wp_query->query_vars;
    $post_per_page = 10;
    /*$winner = 	array(
    			'key' => 'bid',
    			'value' => $uid,
    			'compare' => '='
    		);*/
    global $wpdb;
    $s = "select * from " . $wpdb->prefix . "project_bids where uid='{$uid}'";
    $r = $wpdb->get_results($s);
    foreach ($r as $k => $rr) {
        $pids[] = $rr->pid;
    }
    /*$str_pids = implode(',', $pids);
    
    				var_dump($str_pids);*/
    $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => $query_vars['paged'], 'post__in' => $pids);
    query_posts($args);
    $a = 0;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $a += projectTheme_get_post_my_proposal();
        }
        if (function_exists('wp_pagenavi') && !$a) {
            wp_pagenavi();
        }
    } else {
        echo '<div class="my_box3 border_bottom_0"> <div class="box_content">   ';
        _e("You have not submitted any proposals yet.", 'ProjectTheme');
        echo '</div>  </div> ';
    }
    if ($a) {
        echo '<div class="my_box3"><div class="box_content">';
        _e("There are no projects yet.", 'ProjectTheme');
        echo '</div></div>';
    }
    wp_reset_query();
    ?>
                
         
        
  		</div>      
<?php 
    ProjectTheme_get_users_links();
}
开发者ID:vicpril,项目名称:ProjectTheme,代码行数:57,代码来源:bid_projects.php

示例10: woocommerceframework_pagination

function woocommerceframework_pagination()
{
    $features = get_setting_array('shop_loop_top_bar', array());
    $pagination_pos = get_setting('shop_pagination_pos', 'bottom');
    if (in_array('pagination', $features) && $pagination_pos && ('bottom' == $pagination_pos || 'both' == $pagination_pos)) {
        $args = array('container_class' => 'pagination pagination-lg pull-right', 'echo' => false);
        echo '<div class="row"><div class="col-md-12">' . wp_pagenavi($args) . '</div></div>';
    }
}
开发者ID:rinodung,项目名称:myfreetheme,代码行数:9,代码来源:woocommerce-init.php

示例11: PricerrTheme_blog_posts_area_function

function PricerrTheme_blog_posts_area_function()
{
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    
        
   <div id="content">
			      <div class="my_box3">
            	<div class="padd10">
                    
            
            		<div class="box_title"><?php 
    echo __("All Blog Posts", 'PricerrTheme');
    ?>
</div>
                    
              
            		<div class="box_content">
                    
                    <?php 
    $args = array('post_type' => 'post', 'paged' => get_query_var('paged'));
    $my_query = new WP_Query($args);
    if ($my_query->have_posts()) {
        while ($my_query->have_posts()) {
            $my_query->the_post();
            PricerrTheme_get_post_blog();
        }
        if (function_exists('wp_pagenavi')) {
            wp_pagenavi(array('query' => $my_query));
        }
    } else {
        _e('There are no posts.', 'PricerrTheme');
    }
    ?>
                    
                    </div></div>
  </div></div>
    
    
      <!-- ################### -->
    
    <div id="right-sidebar">    
    	<ul class="xoxo">
        	 <?php 
    dynamic_sidebar('other-page-area');
    ?>
        </ul>    
    </div>
    
    
      
    
    <?php 
}
开发者ID:juliosd,项目名称:legacy-master,代码行数:56,代码来源:blog_posts.php

示例12: hepouf_content_nav

    function hepouf_content_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 = is_single() ? 'post-navigation' : 'paging-navigation';
        ?>
	<nav role="navigation" id="<?php 
        echo esc_attr($nav_id);
        ?>
" class="<?php 
        echo $nav_class;
        ?>
">

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

		<?php 
            previous_post_link('<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x('<i class="ico-left-open"></i>', 'Previous post link', 'athemes') . '</span> %title');
            ?>
		<?php 
            next_post_link('<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x('<i class="ico-right-open"></i>', 'Next post link', 'athemes') . '</span>');
            ?>

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

<?php 
            wp_pagenavi();
            ?>

	<?php 
        }
        ?>

	</nav><!-- #<?php 
        echo esc_html($nav_id);
        ?>
 -->
	<?php 
    }
开发者ID:Jocker666z,项目名称:hepouf,代码行数:56,代码来源:template-tags.php

示例13: ProjectTheme_my_account_delivered_projects_area_function

function ProjectTheme_my_account_delivered_projects_area_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content">
        
        
        	<div class="my_box3 border_bottom_0">
            	
            
            	<div class="box_title"><?php 
    _e("Delivered Projects", 'ProjectTheme');
    ?>
</div>
                <div class="box_content">    
				
                
  <?php 
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    global $wp_query;
    $query_vars = $wp_query->query_vars;
    $post_per_page = 10;
    $outstanding = array('key' => 'delivered', 'value' => "1", 'compare' => '=');
    $paid_user = array('key' => 'paid_user', 'value' => "1", 'compare' => '=');
    $winner = array('key' => 'winner', 'value' => $uid, 'compare' => '=');
    $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => $query_vars['paged'], 'meta_query' => array($outstanding, $winner, $paid_user));
    query_posts($args);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            projectTheme_get_post();
        }
        if (function_exists('wp_pagenavi')) {
            wp_pagenavi();
        }
    } else {
        _e("There are no delivered projects yet.", 'ProjectTheme');
    }
    wp_reset_query();
    ?>
                
                
               
           </div>
           </div>    
        
        
  		</div>      
<?php 
    ProjectTheme_get_users_links();
}
开发者ID:juliosd,项目名称:legacy-master,代码行数:55,代码来源:delivered_projects.php

示例14: lightseek_link_pages

function lightseek_link_pages()
{
    global $post;
    if (is_single()) {
        if (function_exists('wp_pagenavi')) {
            wp_pagenavi(array('type' => 'multipart'));
        } else {
            wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', '_lightseek'), 'after' => '</div>'));
        }
    }
}
开发者ID:amielucha,项目名称:lightseek,代码行数:11,代码来源:template-tags.php

示例15: raindrops_use_wp_pagenav

 /**
  *
  * @param type $link
  * @param type $position
  * @return type
  */
 function raindrops_use_wp_pagenav($link, $position)
 {
     if ('yes' == get_theme_mod('raindrops_wp_pagenavi_status') && 'yes' == raindrops_warehouse_clone('raindrops_plugin_presentation_wp_pagenav')) {
         if (function_exists('wp_pagenavi') and $position == 'nav-below') {
             return wp_pagenavi(array('echo' => false, 'options' => array('prev_text' => esc_html__('Prev', 'raindrops'), 'next_text' => esc_html__('Next', 'raindrops'))));
         } else {
             return $link;
         }
     }
     return;
 }
开发者ID:TheRojam,项目名称:raindrops,代码行数:17,代码来源:plugins-presentation.php


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