WordPress.org

Ready to get started?Download WordPress

Forums

pagination with wp_link_pages and <!--nextpage--> (2 posts)

  1. dovydas
    Member
    Posted 4 years ago #

    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?

  2. dovydas
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic