WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Repeater last item (2 posts)

  1. Mario
    Member
    Posted 2 years ago #

    I want to use another style for the last item in repeater. What should I add to my source code?

    $rows = get_field('FIELD');
    if($rows)
    {
    echo '<ul>';
    
    foreach($rows as $row)
    {
    echo '<li>' . $row['VALUE1'] . '</li>';
    }
    
    echo '</ul>';
    }

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. Jason Bahl
    Member
    Posted 2 years ago #

    You could use the :last-child in your css to style the last item differently. Some older browsers may not support it though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic