Support

Account

Home Forums Add-ons Repeater Field Repeater Pagination

Helping

Repeater Pagination

  • I am looking to only allow 5 items per page here: http://victory-sites.com/modern-companies/our-portfolio/

    The way the repeater works is this:
    The user displays the project on the page by using a repeater where they select the projects page. The code then pulls the information from the project page on to the portfolio page.

    Here is the code that displays it on the page:
    <? $rows = get_field(‘portfolio_items’);
    if($rows)
    {
    foreach($rows as $row)
    {
    $emptyMessage = ”;
    $single_portfolio_item=$row[‘single_portfolio_item’];
    $thepageid = $single_portfolio_item->ID;
    ?>

    < a href=”<?php echo get_permalink($single_portfolio_item->ID); ?>”>
    <div class=”singleportitem”>
    <div class=”holdimage”>
    <?php
    $rows = get_field(‘project_images’, $thepageid);
    if($rows)
    {
    $show = “0”;
    foreach($rows as $row)
    {
    $imageother=$row[‘image’];
    $business_tags=$row[‘business_tags’];
    if ($show == “0”) {

    ?>
    ” height=”137px” />
    <? }
    $show ++;
    } } ?>
    </div>
    <div class=”holdinfo”>
    <span class=”porttitle”><?php echo $single_portfolio_item->post_title ?></span>
    <?php if( get_field(‘location’, $thepageid) ) { ?>
    <span class=”portlocationyear”><? the_field(‘location’, $thepageid); ?></span>
    <?php } ?>
    <?php if( get_field(‘year_completed’, $thepageid) ){ ?>
    <span class=”portlocationyear”><? the_field(‘year_completed’, $thepageid); ?></span>
    <?php } ?>
    <?php if( get_field(‘project_teaser’, $thepageid) ){ ?>
    <span class=”portlocationyear2″><? the_field(‘project_teaser’, $thepageid); ?>…</span>
    <?php } ?>
    </div>
    <div class=”moreinfobtn”></div>
    </div>
    <? } } ?>

    I have tried some examples I found and could not seem to figure out how to do it with pulling information from another page.

  • Seems you got it to work, could you post your final code? Thanks! 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.