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

PHP next_posts函数代码示例

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

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



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

示例1: kb_scripts

function kb_scripts()
{
    wp_enqueue_style('Google-Fonts', 'https://fonts.googleapis.com/css?family=Roboto:300,400|Open+Sans:400,600,700');
    wp_enqueue_style('Normalizer', get_template_directory_uri() . '/normalize.css');
    wp_enqueue_style('Chosen', get_template_directory_uri() . '/chosen/chosen.css');
    wp_enqueue_style('Dropzone', get_template_directory_uri() . '/css/dropzone.css');
    wp_enqueue_style('Main', get_stylesheet_uri(), array(), '1.01', false);
    wp_enqueue_script('bx-js', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '1.0.1', true);
    wp_enqueue_script('easing-js', get_template_directory_uri() . '/js/jquery.easing.1.3.js', array('jquery'), '1.0.1', true);
    wp_enqueue_script('chosen-js', get_template_directory_uri() . '/js/chosen.jquery.min.js', array('jquery'), '1.0.1', true);
    wp_enqueue_script('custom-js', get_template_directory_uri() . '/js/custom.js', array('jquery'), '1.0.1', true);
    if (is_page_template(array('page-create-basic-listing.php', 'page-edit-basic-listing.php', 'page-create-paid-listing.php', 'page-edit-paid-listing.php', 'page-create-basic-listing-fr.php', 'page-edit-basic-listing-fr.php', 'page-create-paid-listing-fr.php', 'page-edit-paid-listing-fr.php'))) {
        wp_enqueue_script('dropzone', get_template_directory_uri() . '/js/dropzone.js', array('jquery'), '1.0.1', 'true');
    }
    //		if(is_page_template(array('page-create-paid-listing.php', 'page-edit-paid-listing.php'))) {
    //			wp_enqueue_script('stripejs', 'https://js.stripe.com/v2/', array(''), '1.0.1', 'false');
    //		}
    if (is_page_template('page-paid-listing.php')) {
        wp_register_script('googlemap', 'https://maps.google.com/maps/api/js?sensor=false', 'jquery');
        wp_enqueue_script('googlemap');
    }
    if (!is_admin()) {
        wp_localize_script('custom-js', 'my_ajax', array('ajaxurl' => admin_url('admin-ajax.php')));
    }
    if (is_home() || is_category() || is_archive()) {
        wp_enqueue_script('blog-js', get_template_directory_uri() . '/js/ajax-blog.js', array('jquery'), '1.0.1', true);
        global $wp_query;
        // What page are we on? And what is the pages limit?
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Add some parameters for the JS.
        wp_localize_script('blog-js', 'pbd_alp', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false)));
    }
}
开发者ID:altim,项目名称:kallababy,代码行数:34,代码来源:functions.php


示例2: moove_localize_script

 /**
  * Register global variables to head, AJAX, Form validation messages
  *
  * @param  string $ascript Localize function name.
  */
 public function moove_localize_script($ascript)
 {
     global $wp_query;
     $max = $wp_query->max_num_pages;
     $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
     $this->loc_data = array('ajaxurl' => admin_url('admin-ajax.php'), 'startpage' => $paged, 'maxpages' => $max, 'nextlink' => next_posts($max, false), 'validationoptions' => get_option('moove_protection-validation'));
     wp_localize_script($ascript, 'moove_front_end_scripts', $this->loc_data);
 }
开发者ID:MooveAgency,项目名称:Post-Protection-and-Registration-Wall,代码行数:13,代码来源:moove-actions.php


示例3: voidx_enqueue_scripts

function voidx_enqueue_scripts()
{
    $script_name = '';
    // Empty by default, may be populated by conditionals below
    $script_vars = array();
    // An empty array that can be filled with variables to send to front-end scripts
    $script_handle = 'voidx';
    // A generic script handle
    $suffix = '.min';
    // The suffix for minified scripts
    $ns = 'wp';
    // Namespace for scripts
    // Load original scripts when debug mode is on; this allows for easier local development
    if (WP_DEBUG === true) {
        $suffix = '';
    }
    // Figure out which script bundle to load based on various options set in `src/functions-config-defaults.php`
    // Note: bundles require less HTTP requests at the expense of addition caching hits when different scripts are requested
    // You could also load one main bundle on every page with supplementary scripts as needed (e.g. for commenting or a contact page)
    // An example integration using WP AJAX Page Loader; this script requires a bit more setup as outlined in the documentation: https://github.com/synapticism/wp-ajax-page-loader
    $script_vars_page_loader = '';
    // This conditional establishes whether the page loader bundle is loaded or not; you can turn this off completely from the theme configuration file if you wish (or just remove the code)
    if (VOIDX_SCRIPTS_PAGELOAD && (is_archive() || is_home() || is_search())) {
        $script_name .= '-pageloader';
        // This is used to generate the filename that the theme will serve to the user; it is additive to allow for multiple features that can be toggled in the theme configuration
        global $wp_query;
        // This chunk of code provisions the script with some important information it needs: What page are we on? And what is the page limit?
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Prepare script variables; note that these are separate from the rest of the script variables as this script requires everything in an object named `PG8Data`
        $script_vars_page_loader = array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false));
    }
    // WP AJAX Page Loader configuration ends
    // Default script name
    if (empty($script_name)) {
        $script_name = '-core';
    }
    // Load theme-specific JavaScript bundles with versioning based on last modified time; http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/
    // The handle is the same for each bundle since we're only loading one script; if you load others be sure to provide a new handle
    wp_enqueue_script($script_handle, get_stylesheet_directory_uri() . '/js/' . $ns . $script_name . $suffix . '.js', array('jquery'), filemtime(get_template_directory() . '/js/' . $ns . $script_name . $suffix . '.js'), true);
    wp_enqueue_script('egiis-script', get_stylesheet_directory_uri() . '/js/' . 'wp-core.min.js');
    // Pass variables to JavaScript at runtime; see: http://codex.wordpress.org/Function_Reference/wp_localize_script
    $script_vars = apply_filters('voidx_script_vars', $script_vars);
    if (!empty($script_vars)) {
        wp_localize_script($script_handle, 'voidxVars', $script_vars);
    }
    // Script variables for WP AJAX Page Loader (these are separate from the main theme script variables due to the naming requirement; the object must be `PG8Data`)
    if (!empty($script_vars_page_loader)) {
        wp_localize_script($script_handle, 'PG8Data', $script_vars_page_loader);
    }
    // Register and enqueue our main stylesheet with versioning based on last modified time
    wp_register_style('voidx-style', get_stylesheet_uri(), $dependencies = array(), filemtime(get_template_directory() . '/style.css'));
    wp_enqueue_style('voidx-style');
    wp_enqueue_style('fancySelect', get_stylesheet_directory_uri() . '/fancySelect.css');
}
开发者ID:romainbellande,项目名称:egiis,代码行数:55,代码来源:assets.php


示例4: my_get_next_posts_link

function my_get_next_posts_link($label = 'Next Page »', $max_page = 0)
{
    global $paged, $wp_query;
    if (!$paged) {
        $paged = 1;
    }
    $nextpage = intval($paged) + 1;
    if (!is_single() && (empty($paged) || $nextpage <= $max_page)) {
        $attr = apply_filters('next_posts_link_attributes', '');
        return '<a href="' . next_posts($max_page, false) . "\" {$attr}>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) . '</a>';
    }
}
开发者ID:shimia90,项目名称:management,代码行数:12,代码来源:functions.php


示例5: salp_init

/**
 * Initialization. Add our script if needed on this page.
 */
function salp_init()
{
    global $wp_query;
    if (!is_singular()) {
        wp_enqueue_style('salp-style', plugin_dir_url(__FILE__) . 'css/style.css', false, '1.0', 'all');
        wp_enqueue_script('salp-script', plugin_dir_url(__FILE__) . 'js/load-posts.js', array('jquery'), '1.0', false);
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Add some parameters for the JS.
        wp_localize_script('salp-script', 'salp', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false)));
    }
}
开发者ID:eiffelqiu,项目名称:simple-ajax-load-posts,代码行数:15,代码来源:simple-ajax-load-posts.php


示例6: pbd_alp_init

/**
 * Initialization. Add our script if needed on this page.
 */
function pbd_alp_init()
{
    global $wp_query;
    // Add code to index pages.
    if (!is_singular()) {
        // Queue JS and CSS
        // What page are we on? And what is the pages limit?
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Add some parameters for the JS.
        wp_localize_script('pbd-alp-load-posts', 'pbd_alp', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false)));
    }
}
开发者ID:WackoMako,项目名称:stonedape,代码行数:16,代码来源:pbd-ajax-load-posts.php


示例7: tm_alp_init

function tm_alp_init()
{
    global $wp_query;
    $num_page = 0;
    // Add code to index pages.
    if (!is_singular() || is_page_template('page-templates/tpl-video-listing.php') || is_page_template('page-templates/tpl-blog-listing.php') || $wp_query->post->ID == 605) {
        // Queue JS and CSS
        wp_enqueue_script('pbd-alp-load-posts', plugin_dir_url(__FILE__) . 'js/load-posts.js', array('jquery'), '1.0', true);
        wp_enqueue_style('pbd-alp-style', plugin_dir_url(__FILE__) . 'css/style.css', false, '1.0', 'all');
        // What page are we on? And what is the pages limit?
        if (is_page_template('page-templates/tpl-video-listing.php')) {
            $paged = get_query_var('paged') ? get_query_var('paged') : 1;
            $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-video'), 'operator' => 'IN')));
            $listing_query = new WP_Query($args);
            $num_page = $listing_query->max_num_pages;
        }
        if (is_page_template('page-templates/tpl-blog-listing.php')) {
            $paged = get_query_var('paged') ? get_query_var('paged') : 1;
            $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-video'), 'operator' => 'NOT IN')));
            $listing_query = new WP_Query($args);
            $num_page = $listing_query->max_num_pages;
        }
        if ($wp_query->post->ID == 605) {
            $paged = get_query_var('paged') ? get_query_var('paged') : 1;
            $arg = array('cat' => '1', 'post_type' => 'post', 'posts_per_page' => 15, 'paged' => $paged, 'meta_key' => 'event_begin', 'orderby' => 'meta_value', 'order' => 'DESC');
            // DATES
            $meta_query = array(array('key' => 'event_end', 'value' => '', 'compare' => '!='), array('key' => 'event_begin', 'value' => '', 'compare' => '!='));
            $meta_query[] = array('key' => 'event_end', 'value' => date('Y-m-d'), 'compare' => '<');
            $arg['meta_query'] = $meta_query;
            $listing_query = new WP_Query($arg);
            $num_page = $listing_query->max_num_pages;
        }
        if (isset($_GET['orderby']) && $_GET['orderby'] == 'resumen') {
            $arg = array('post_type' => 'post', 'posts_per_page' => 8, 'paged' => $paged, 'cat' => 177);
            $list_query = new WP_Query($arg);
            $num_page = $list_query->max_num_pages;
        }
        if ($num_page != 0) {
            $max = $num_page;
        } else {
            $max = $wp_query->max_num_pages;
        }
        $q_v = get_template_directory_uri() . '/js/html5lightbox.js';
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        $text_lb1 = __('More', 'cactusthemes');
        $text_lb2 = __('Loading posts', 'cactusthemes');
        // Add some parameters for the JS.
        $ot_permali = get_option('permalink_structure');
        wp_localize_script('pbd-alp-load-posts', 'pbd_alp', array('startPage' => $paged, 'maxPages' => $max, 'textLb1' => $text_lb1, 'textLb2' => $text_lb2, 'ot_permali' => $ot_permali, 'nextLink' => next_posts($max, false), 'quick_view' => $q_v));
    }
}
开发者ID:venamax,项目名称:trixandtrax-cl,代码行数:51,代码来源:tm-ajax-load-posts.php


示例8: voidx_enqueue_scripts

function voidx_enqueue_scripts()
{
    $script_name = '';
    // Empty by default, may be populated by conditionals below; this is used to generate the script filename
    $script_vars = array();
    // An empty array that can be filled with variables to send to front-end scripts
    $script_handle = 'voidx';
    // A generic script handle used internally by WordPress
    $ns = 'wp';
    // Namespace for scripts; this should match what is specified in your `gulpconfig.js` (and it's safe to leave alone)
    // Figure out which script bundle to load based on various options set in `src/functions-config-defaults.php`
    // Note: bundles require fewer HTTP requests at the expense of addition caching hits when different scripts are requested on different pages of your site
    // You could also load one main bundle on every page with supplementary scripts as needed (e.g. for commenting or a contact page); it's up to you!
    // == EXAMPLE INTEGRATION == //
    // An example integration using WP AJAX Page Loader; this script requires a bit more setup as outlined in the documentation: https://github.com/synapticism/wp-ajax-page-loader
    $script_vars_page_loader = '';
    // This conditional establishes whether the page loader bundle is loaded or not; you can turn this off completely from the theme configuration file if you wish (or just remove the code)
    if (VOIDX_SCRIPTS_PAGELOAD && (is_archive() || is_home() || is_search())) {
        // The script name is used to specify the file that the theme will serve to users
        // Script names are designed to be additive (meaning you can append more script names to the end in other conditional blocks using `.= '-anotherscript'` etc.) to allow for multiple feature toggles in the theme configuration
        $script_name .= '-pageloader';
        // This chunk of code provisions the WP AJAX Page Loader script with some important information it needs: What page are we on? And what is the page limit?
        global $wp_query;
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Prepare script variables; note that these are separate from the rest of the script variables as the WP AJAX Page Loader script requires everything in a specific object named `PG8Data`
        $script_vars_page_loader = array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false));
    }
    // WP AJAX Page Loader configuration ends
    // Default script name; used when conditional blocks (above) aren't triggered
    if (empty($script_name)) {
        $script_name = '-core';
    }
    // Load theme-specific JavaScript bundles with versioning based on last modified time; http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/
    // The handle is the same for each bundle since we're only loading one script; if you load others be sure to provide a new handle
    wp_enqueue_script($script_handle, get_stylesheet_directory_uri() . '/js/' . $ns . $script_name . '.js', array('jquery'), filemtime(get_template_directory() . '/js/' . $ns . $script_name . '.js'), true);
    // Pass variables to JavaScript at runtime; see: http://codex.wordpress.org/Function_Reference/wp_localize_script
    $script_vars = apply_filters('voidx_script_vars', $script_vars);
    if (!empty($script_vars)) {
        wp_localize_script($script_handle, 'voidxVars', $script_vars);
    }
    // Script variables specific to WP AJAX Page Loader (these are separate from the main theme script variables due to the naming requirement; the object *must* be `PG8Data`)
    // This appears here and NOT in the conditional block (above) because these variables will be attached to the main script handle (which may be modified after the page loader block)
    if (!empty($script_vars_page_loader)) {
        wp_localize_script($script_handle, 'PG8Data', $script_vars_page_loader);
    }
    // Register and enqueue our main stylesheet with versioning based on last modified time
    wp_register_style('voidx-style', get_stylesheet_uri(), $dependencies = array(), filemtime(get_template_directory() . '/style.css'));
    wp_enqueue_style('voidx-style');
}
开发者ID:vespertines,项目名称:wordpress-gulp-bower-sass,代码行数:50,代码来源:assets.php


示例9: vntd_ajax_pagination

function vntd_ajax_pagination($query = null)
{
    global $wp_query;
    // Add code to index pages.
    wp_enqueue_script('ajax-load-posts', get_template_directory_uri() . '/js/jquery.load-posts.js', array('jquery'));
    if (!$query) {
        $query = $wp_query;
    }
    // What page are we on? And what is the pages limit?
    $max = $query->max_num_pages;
    $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
    // Add some parameters for the JS.
    wp_localize_script('ajax-load-posts', 'pbd_alp', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false)));
}
开发者ID:ericsoncardosoweb,项目名称:agatha-wp,代码行数:14,代码来源:general-functions.php


示例10: posts_alp_init

function posts_alp_init()
{
    global $wp_query;
    // Add code to index pages.
    if (!is_singular()) {
        // Queue JS file
        wp_enqueue_script('posts-alp-load-posts', plugin_dir_url(__FILE__) . 'load-posts.js', array('jquery'), '1.0', true);
        // Grab page from query and max number of pages
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Add some parameters for the JS.
        wp_localize_script('posts-alp-load-posts', 'posts_alp', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false)));
    }
}
开发者ID:steveferrar,项目名称:60degrees.com,代码行数:14,代码来源:ajax-load-posts.php


示例11: pbd_alp_init

/**
 * Initialization. Add our script if needed on this page.
 */
function pbd_alp_init()
{
    $args = array('post_type' => 'post', 'showposts' => 3, 'paged' => $paged);
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query($args);
    // Add code to index pages.
    if (is_page_template('category.php')) {
        // Queue JS and CSS
        wp_enqueue_script('pbd-alp-load-posts', get_template_directory_uri() . '/inc/pbd-ajax-load-posts/js/load-posts.js', array('jquery'), '1.0', true);
        wp_enqueue_style('pbd-alp-style', get_template_directory_uri() . '/inc/pbd-ajax-load-posts/css/style.css', false, '1.0', 'all');
        // What page are we on? And what is the pages limit?
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Add some parameters for the JS.
        wp_localize_script('pbd-alp-load-posts', 'pbd_alp', array('startPage' => $paged, 'maxPages' => $wp_query->max_num_pages, 'nextLink' => next_posts($max, false)));
    }
}
开发者ID:vee879,项目名称:wordpress_4_3_1,代码行数:21,代码来源:pbd-ajax-load-posts.php


示例12: voidx_assets_footer

function voidx_assets_footer()
{
    // Initialize variables
    $name = 'voidx-footer';
    // This is the script handle
    $file = 'x';
    // The beginning of the filename; "x" is the namespace set in `gulpconfig.js`
    $vars = array();
    // An empty array that may be populated by script variables for output with `wp_localize_script` after the footer script is enqueued
    // This approach allows for conditional loading of various script bundles based on options set in `src/functions-config-defaults.php`
    // Note: bundles require fewer HTTP requests at the expense of addition caching hits when different scripts are requested on different pages of your site
    // You could also load one main bundle on every page with supplementary scripts as needed (e.g. for commenting or a contact page); it's up to you!
    // Example integraton: WP AJAX Page Loader (similar to Infinite Scroll); this script is only loaded when the conditions below are met
    // This script must be provisioned with some extra data via the `wp_localize_script` function as outlined in the documentation: https://github.com/synapticism/wp-ajax-page-loader
    if (VOIDX_SCRIPTS_PAGELOAD && (is_archive() || is_home() || is_search())) {
        // Script filenames are designed to be additive (meaning you can append more script names to the end in other conditional blocks using `.= '-anotherscript'` etc.) to allow for multiple feature toggles in the theme configuration
        // Have a look at `gulpconfig.js` to see where these script names are defined
        $file .= '-pageloader';
        // This chunk of code provisions the script with vital info: What page are we on? And what is the page limit?
        global $wp_query;
        $max = $wp_query->max_num_pages;
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // Prepare script variables that will be output after the footer script is enqueued
        $vars['PG8Data'] = array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false));
    }
    // If none of the conditons were matched (above) let's output the default script name
    if ($file === 'x') {
        $file .= '-footer';
    }
    // Load theme-specific JavaScript bundles with versioning based on last modified time; http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/
    // The handle is the same for each bundle since we're only loading one script; if you load others be sure to provide a new handle
    wp_enqueue_script($name, get_stylesheet_directory_uri() . '/js/' . $file . '.js', array('jquery'), filemtime(get_template_directory() . '/js/' . $file . '.js'), true);
    // This last `true` is what loads the script in the footer
    // Pass variables to scripts at runtime; must be triggered after the script is enqueued; see: http://codex.wordpress.org/Function_Reference/wp_localize_script
    if (!empty($vars)) {
        foreach ($vars as $var => $data) {
            wp_localize_script($name, $var, $data);
        }
    }
}
开发者ID:shoetten,项目名称:bedrock-gulp,代码行数:40,代码来源:assets.php


示例13: pcode_init

 /**
  * Initialization. Add our script if needed on this page.
  */
 function pcode_init() {
 	global $wp_query;
 
 	// Add code to index pages.
 	if( !is_singular() ) {	
 		// Queue JS and CSS
 		wp_enqueue_script(
 			'pcode-load-posts',
 			plugin_dir_url( __FILE__ ) . 'js/load-posts.js',
 			array('jquery'),
 			'1.0',
 			true
 		);
 		
 		wp_enqueue_style(
 			'pcode-style',
 			plugin_dir_url( __FILE__ ) . 'css/style.css',
 			false,
 			'1.0',
 			'all'
 		);
 		
 		// What page are we on? And what is the pages limit?
 		$max = $wp_query->max_num_pages;
    $numPosts = $wp_query->$found_posts;
 		$paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;
 		
 		// Add some parameters for the JS.
 		wp_localize_script(
 			'pcode-load-posts',
 			'pcode',
 			array(
 				'startPage' => $paged,
 				'maxPages' => $max,
        'numPosts' => $numPosts,
 				'nextLink' => next_posts($max, false)
 			)
 		);
 	}
 }
开发者ID:nvminhtu,项目名称:Wordpress_plugin,代码行数:43,代码来源:pbd-ajax-load-posts.php


示例14: wp_load_more_posts_init

function wp_load_more_posts_init()
{
    global $wp_query;
    // Add code to index and archive pages.
    if (is_home() || is_archive() || is_tax()) {
        // Queue JS and CSS
        wp_enqueue_script('wp-load-more-posts-js', plugin_dir_url(__FILE__) . 'library/js/load-more.js', array('jquery'), '1.0');
        // What page are we on?
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        // How many pages of posts do we have to display?
        $max = $wp_query->max_num_pages;
        // Here we set values from the plugin options page
        $content_selector = wp_lmp_get_option('content_selector');
        $post_class_selector = wp_lmp_get_option('post_class_selector');
        $pager_selector = wp_lmp_get_option('pager_selector');
        $btn_class = wp_lmp_get_option('btn_class');
        $load_more_text = wp_lmp_get_option('load_more_text');
        $loading_text = wp_lmp_get_option('loading_text');
        $no_posts_text = wp_lmp_get_option('no_posts_text');
        // Add some parameters for the JS.
        wp_localize_script('wp-load-more-posts-js', 'wpLoadMorePosts', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false), 'contentSelector' => sanitize_text_field($content_selector), 'postClassSelector' => sanitize_text_field($post_class_selector), 'pagerSelector' => sanitize_text_field($pager_selector), 'btnClass' => sanitize_html_class($btn_class), 'loadMoreText' => esc_html($load_more_text), 'loadingText' => esc_html($loading_text), 'noPostsText' => esc_html($no_posts_text)));
    }
}
开发者ID:RachelleLortie,项目名称:transitapp,代码行数:23,代码来源:wp-load-more-posts.php


示例15: tm_alp_init

function tm_alp_init()
{
    global $wp_query;
    $num_page = 0;
    // Add code to index pages.
    if (!is_singular() || is_page_template('page-templates/tpl-video-listing.php') || is_page_template('page-templates/tpl-blog-listing.php')) {
        // Queue JS and CSS
        wp_enqueue_script('pbd-alp-load-posts', plugin_dir_url(__FILE__) . 'js/load-posts.js', array('jquery'), '1.0', true);
        wp_enqueue_style('pbd-alp-style', plugin_dir_url(__FILE__) . 'css/style.css', false, '1.0', 'all');
        // What page are we on? And what is the pages limit?
        if (is_page_template('page-templates/tpl-video-listing.php')) {
            $paged = get_query_var('paged') ? get_query_var('paged') : 1;
            $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-video'), 'operator' => 'IN')));
            $listing_query = new WP_Query($args);
            $num_page = $listing_query->max_num_pages;
        }
        if (is_page_template('page-templates/tpl-blog-listing.php')) {
            $paged = get_query_var('paged') ? get_query_var('paged') : 1;
            $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-video'), 'operator' => 'NOT IN')));
            $listing_query = new WP_Query($args);
            $num_page = $listing_query->max_num_pages;
        }
        if ($num_page != 0) {
            $max = $num_page;
        } else {
            $max = $wp_query->max_num_pages;
        }
        $q_v = get_template_directory_uri() . '/js/colorbox/jquery.colorbox-min.js';
        $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
        $text_lb1 = __('MORE', 'cactusthemes');
        $text_lb2 = __('LOADING POSTS', 'cactusthemes');
        // Add some parameters for the JS.
        $ot_permali = get_option('permalink_structure');
        wp_localize_script('pbd-alp-load-posts', 'pbd_alp', array('startPage' => $paged, 'maxPages' => $max, 'textLb1' => $text_lb1, 'textLb2' => $text_lb2, 'ot_permali' => $ot_permali, 'nextLink' => next_posts($max, false), 'quick_view' => $q_v));
    }
}
开发者ID:aljeicks,项目名称:streamtube,代码行数:36,代码来源:tm-ajax-load-posts.php


示例16: next_posts_link

function next_posts_link($label = 'Next Page &raquo;', $max_page = 0)
{
    global $paged, $wp_query;
    if (!$max_page) {
        $max_page = $wp_query->max_num_pages;
    }
    if (!$paged) {
        $paged = 1;
    }
    $nextpage = intval($paged) + 1;
    if (!is_single() && (empty($paged) || $nextpage <= $max_page)) {
        echo '<a href="';
        next_posts($max_page);
        echo '">' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) . '</a>';
    }
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:16,代码来源:link-template.php


示例17: mpcth_load_more_hook

function mpcth_load_more_hook($query, $type = 'blog', $custom = array())
{
    global $mpcth_settings;
    wp_enqueue_script('mpcth-isotope', MPC_THEME_ROOT . '/mpc-wp-boilerplate/js/mpcth-isotope.js', array('jquery'), '1.0');
    $paginationInfo = array('max_pages' => $query->max_num_pages, 'posts_count' => $query->found_posts, 'posts_per_page' => $query->post_count, 'post_type' => $type == 'blog' ? 'post' : $type, 'page' => mpcth_get_paged(), 'next_page_link' => next_posts($query->max_num_pages, false), 'path' => MPC_THEME_ROOT, 'loading_text' => __('Loading...', 'mpcth'), 'load_more_text' => __('Load More', 'mpcth'), 'blog_type' => $mpcth_settings[$type . 'Type'], 'blog_post_columns_number' => $mpcth_settings[$type . 'ColumnsNumber'], 'mpcth_settings' => $mpcth_settings);
    $paginationInfo['custom'] = array();
    if (!empty($custom)) {
        foreach ($custom as $key => $value) {
            $paginationInfo['custom'][$key] = $value;
        }
    }
    wp_localize_script('mpcth-isotope', 'paginationInfo', $paginationInfo);
}
开发者ID:kidaak,项目名称:lostineverfree,代码行数:13,代码来源:mpcth-functions.php


示例18: dynamic_sidebar

		<div class="span4 side-right-cont sidebar-blog progressive">
			<div class="sidebar-cont">
				<div class="entry-cont">
					<?php dynamic_sidebar('sidebar-primary'); ?>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>

<?php } ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
  <div class="load-more inside hvr progressive">
   	<div class="entry-text-cont">
   		<?php get_next_posts_link(); ?>
  		<a href="#" data-pages="<?php echo $wp_query->max_num_pages; ?>" data-page="<?php echo $paged; ?>" data-link="<?php echo next_posts($wp_query->max_num_pages, false); ?>">More Items...</a>
   	</div>
  </div>
<?php endif; ?>

<?php if (!is_home()) { ?>
<style media="screen" type="text/css">

.isotope-item:nth-child(3) .entry-text-cont{
 display:block !important;
}

</style>

<?php } ?>
开发者ID:jackmachin,项目名称:bayer,代码行数:30,代码来源:content.php


示例19: _e

			</div>
		</div>

		<?php 
if ($blog_pagination == 'infinite_scroll_blog_pagination') {
    ?>
		
		<div class="infinite-scroll">
			<span class="preloader"></span>
			<p class="end"><?php 
    _e('No More Posts', AZ_THEME_NAME);
    ?>
</p>
			<a id="infinite-link" href="<?php 
    echo next_posts(0, false);
    ?>
"><?php 
    _e('Load More Posts', AZ_THEME_NAME);
    ?>
</a>
		</div>

		<?php 
} else {
    echo az_normal_pagination();
}
?>


	</section>
开发者ID:pattysanchez,项目名称:letsrumbl-wordpress,代码行数:30,代码来源:index.php


示例20: ep_Load_Posts_Init

function ep_Load_Posts_Init()
{
    // Add some parameters for the JS - blog load more .
    $queryArgsPost = array('post_type' => 'post');
    $query = new WP_Query($queryArgsPost);
    $max = $query->max_num_pages;
    $paged = get_query_var('paged') > 1 ? get_query_var('paged') : 1;
    wp_localize_script('ep_custom', 'paged_data', array('startPage' => $paged, 'maxPages' => $max, 'nextLink' => next_posts($max, false), 'loadingText' => __('Loading...', 'epicomedia'), 'loadMoreText' => __('More posts', 'epicomedia'), 'noMorePostsText' => __('No More Posts', 'epicomedia')));
    wp_reset_postdata();
}
开发者ID:rmilano24,项目名称:moto,代码行数:10,代码来源:scripts.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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