Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Paged for custom terms on wordpress

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #189238
    Shpend Berisha
    Participant

    Hi to everyone I created custom terms on a wordpress theme wich Im doing.
    Everything is fine but the problem is on post per page or pagination my codes of the page are below:

    `
    <?php
    /*
    Template Name: Template Pornstars
    */
    get_header();
    ?>
    <?php if ( get_query_var( ‘paged’ ) )
    $paged = get_query_var(‘paged’);
    else if ( get_query_var( ‘page’ ) )
    $paged = get_query_var( ‘page’ );
    else
    $paged = 1;

    $per_page = 1;
    $total_terms = 12; // This needs to be the total number of series (count the number of terms in the series with a function)
    $offset = $per_page * ( $paged – 1) ;

    // Setup the arguments to pass in
    $args = array(
    ‘order’ => ‘ASC’,
    ‘offset’ => $offset,
    );
    // Gather the series
    $pornstarlist = get_terms( ‘pornstar’, $args ); ?>

    <div class=”mainw”><div class=”main l170″>
    <h2><?php _e(‘PornStar List’, ‘test’); ?></h2>
    <div class=”clear”></div>
    <div class=”clear”></div>
    <?php foreach $pornstarlist as $cat) : ?>
    <div class=”item”>
    <div class=”photo-thumb”>
    <a href=”<?php echo get_term_link($cat->slug, ‘pornstar’); ?>”>
    <img width=”220″ height=”290″ src=”<?php echo z_taxonomy_image_url($cat->term_id,NULL, array(220, 290)); ?>” /> </a></div>
    <h2 class=”thumb-title”>
    <a href=”<?php echo get_term_link($cat->slug, ‘pornstar’); ?>”>
    <p><?php echo $cat->name; ?><br />
    Total Videos <?php
    $catcount = $cat->count;
    echo $catcount;
    ?>
    </p>
    <div class=”clear”></div>
    </div>
    <?php
    endforeach;
    ?>
    </div>
    </div>
    <?php
    get_sidebar();
    get_footer();
    ?>
    `

    I dont know where Im wrong,it seems ok but I couldnt get it working.
    Can anyone help ? thankyou

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.