Home › Forums › Add-ons › Repeater Field › 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! 🙂
The topic ‘Repeater Pagination’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.