pagination not show on wordpress page

Discussion in 'WordPress' started by Tuhin1234, Feb 1, 2018.

  1. #1
    Here is my full page code ,i can't fix this , anyone please help .

    <?php
    /*
    Template Name: Gallery
    */
    ?>
    <?php get_header(); ?>
    <center><?php include('adsup.php'); ?></center>
    <div class="mainw"><div class="main l170">
    <h1><?php _e('Recently Added Free indian Photos', 'mytheme'); ?></span></h1>
    
        <?php query_posts(array('posts_per_page' => 21, 'post_type' => 'gallery', 'order' => 'DESC', 'ignore_sticky_posts' => 'true', 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), )); ?>
            <?php if ( have_posts() ) : ?>
    <ul class="listThumbs">
    <?php if (get_option('mtn_adsindex') <> '') { ?>
    <li class="adsRight">
    <?php echo stripslashes(get_option('mtn_adsindex')); ?>
    </li>
      <?php } else { ?>
    <?php } ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <li class="thumi">
    <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
    <img src="<?php echo get_post_meta($post->ID, 'thumb', true); ?>" alt="<?php the_title_attribute(); ?>" style=" height:235px;> </a>
    <span class="scrub"><span></span></span></a>
    <a href="<?php the_permalink(); ?>" class="title" rel="bookmark"><?php if (strlen($post->post_title) > 40) {
    echo substr(the_title($before = '', $after = '', FALSE), 0, 45) . '...'; } else {
    the_title();
    } ?></a>
    <span class="added">
    <?php if(function_exists('the_views')) { the_views(); } ?>&nbsp;views
    </span><span class="rating"><?php echo time_ago(); ?></span>
    </li>
    <?php
    endwhile;
    wp_reset_query();
    ?>
    </ul>
            <?php else : ?>
    
                <p><?php _e('No Photos Found', 'mytheme'); ?></p>
    
            <?php endif; ?>
    <div class="navigation"><?php if (function_exists("pagination")) {
    pagination($additional_loop->max_num_pages);
    } ?></div>
    </div>
    </div>
    <?php include (TEMPLATEPATH . '/galleryside.php'); ?>
    <center>
    <?php include('adsfoot.php'); ?>
    <p>
    <div class="foot2">
    <?php get_search_form(); ?>
    </div>
    <p>
    <div class="foot2">
    <?php include('footads.php'); ?>
    </div>
    </center>
    <?php get_footer(); ?>
    PHP:
     
    Last edited: Feb 1, 2018
    Tuhin1234, Feb 1, 2018 IP
  2. tricks2

    tricks2 Active Member

    Messages:
    427
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #2
    I am not sure, but this may work for you...
    just an idea
    if( $attribute['pagination']==true){

    $pagination_n .='<div class="col-md-12">';

    /*
    * Remember to set our maximum pages for the custom query*/if( function_exists('n_pagination')){

    $pagination_n .=n_pagination( $q->max_num_pages );

    }else{

    $pagination_n .= get_next_posts_link('&laquo;&laquo; Older Posts', $q->max_num_pages );
    $pagination_n .= get_previous_posts_link('Newer Posts &raquo;&raquo;');

    }

    $pagination_n .='</div>';
     
    tricks2, Feb 14, 2018 IP
  3. kellyrose

    kellyrose Active Member

    Messages:
    103
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    85
    #3
    I think it works out try to use a custom pagination plugin like https://wordpress.org/plugins/wp-paginate/
     
    kellyrose, Feb 14, 2018 IP
  4. Kaiti

    Kaiti Well-Known Member

    Messages:
    136
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    133
    #4
    or try this plugins is the best https://wordpress.org/plugins/wp-pagenavi/
     
    Kaiti, Feb 15, 2018 IP