0

How can I paginate my custom template page with get_categories() loop?

$args = array (
    'taxonomy' => 'programs-cat',
    'number' => 1,
    'offset' => 1,
)
?>

<?php $programs = get_categories($args);?>
<?php foreach ($programs as $program) { ?>
    <?php
    $term_id = $program->term_id;
    $src = get_field('program_image', 'programs-cat_'. $term_id );
    $image = aq_resize( $src, 1040, 440, true,true,true );
    $date = get_field('program_time', 'programs-cat_'. $term_id );
    $term_link = get_term_link( $program );
    ?>
    <div class="program-one">
            <div class="inner-prog">
                <div class="img">
                    <div class="shedule-back mask-460"></div>
                    <img src="<?php echo $image ?>" />
                    <h3><?=$program->name;?></h3>
                    <p class="pr-date"><?=$date; ?></p>
                </div>
                <div class="pr-content">
                    <div class="pr-cont-left">
                        <p><?=$program->description; ?></p>
                    </div>
                    <div class="pr-cont-right">
                        <div class="newsall-link">
                            <a class="btnews" href="<?php echo esc_url( $term_link );?>">Архив выпусков</a>
                        </div>
                    </div>
                </div>
            </div>
    </div>
<?php } ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.