WordPress.org

Support

Support » Themes and Templates » Foreach Columns & Pagination

Foreach Columns & Pagination

  • I am using the plugin “Categories Images” and using a foreach statement that I am trying to adapt for display of 11 items in three rows for a yearly magazine archive. The 11 items are custom category images (each issue’s image cover with name and description). Each page of 11 items represents one year in the archive. I want to paginate backward and forward to brows each page/year. The items would display as such:

    ABCD
    EFGH
    IJK

    Here is the foreach code on its own:

    foreach (get_terms('magarchive') as $cat) : ?>
        <a href="<?php echo get_term_link($cat->slug, 'magarchive'); ?>"><?php echo $cat->name; ?></h4> - </a><br>
        <em><a href="<?php echo get_term_link($cat->slug, 'magarchive'); ?>"><?php echo $cat->description; ?></a></em></h4><br>
        <a href="<?php echo get_term_link($cat->slug, 'magarchive'); ?>"><img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /></a>
        <?php endforeach; ?>

    I’ve tried applying tables, css, arrays, etc. But I can only get the items to display in a single vertical column. I am just not skilled enough at this point with stylizing the echo of foreach’s output. Any help would be greatly appreciated. Thank you…

  • The topic ‘Foreach Columns & Pagination’ is closed to new replies.
Skip to toolbar