WordPress.org

Support

Support » Plugins and Hacks » pagination with wp_link_pages and <!–nextpage–>

pagination with wp_link_pages and <!–nextpage–>

  • dovydas

    @dovydas

    I am loading the content of the page with function called using page custom field/key. And I want the content af the page to be paginated.

    function runninglog_load($content) {
    global $post;
    $custom_field_key = 'runninglog_load';
    $load_target = get_post_meta($post->ID, $custom_field_key, true);
    if ($load_target == 'races') {
        $content = runninglog_display($load_target);
        }
    return $content;
    }
    
    function runninglog_display($load_target) {
    runninglog_display_weeks();
    echo '<!--nextpage-->';
    runninglog_display_months();
    echo '<!--nextpage-->';
    runninglog_display_years();
    echo '<!--nextpage-->';
    runninglog_display_races();
    echo '<!--nextpage-->';
    runninglog_display_personalbest();
    echo '<!--nextpage-->';
    runninglog_display_shoes();
    }
    
    add_filter('the_content', 'runninglog_load');

    Pagination works fine here on other posts and pages, but it doesn’t work on the page created by my plugin. The content of my page is not getting paginated, it is a single page. How can I make it to be paginated?

Viewing 1 replies (of 1 total)
  • dovydas

    @dovydas

    Will it work if I will copy function wp_link_pages directly to my plugin?

Viewing 1 replies (of 1 total)
  • The topic ‘pagination with wp_link_pages and <!–nextpage–>’ is closed to new replies.
Skip to toolbar