Support

Account

Home Forums Add-ons Repeater Field Paginated Repeater Field: How to add extra page in the beginning?

Helping

Paginated Repeater Field: How to add extra page in the beginning?

  • Hello!

    I have a Custom Post Type for content lists with Repeater Field and pagination. So, there’s a subpage for each item. I used this code: http://jonathannicol.com/blog/2014/03/06/paginating-an-advanced-custom-fields-repeater/

    The problem is: I created a custom field for the list intro text. Is there a way to display this intro field in the first pagination, before the repeater loop?

    It would be like this:

    /post-type/post-title/
    Intro text

    /post-type/post-title/1
    Item 1

    /post-type/post-title/2
    Item 2

    /post-type/post-title/n
    Item n

    Thanks in advance!

  • You can use the following code (just replace the “CODE” with the code you already have).

    <?php if ( ! get_query_var( 'page' ) ) : ?> 
    	<?php the_field( 'the_field_you_want_to_display' ); ?>
    <?php else : ?>
    	CODE
    <?php endif; ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.