Support » Plugin: WP-Paginate » No Paging visible on custom theme

  • Hi. Your integration docs show options for the standard wordpress themes (twentyThirteen etc.) I have a custom theme that uses the code below. I tried replacing “twentyFifteen” with my theme name (“thermal”) but it doesn’t work. I tried upper and lower case.

    
    <?php $the_query = new WP_Query( 'posts_per_page=8'); ?>
    <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
    
    // render title, excerpt etc here
    
    <?php 
    endwhile;
       the_posts_pagination( array(
            'prev_text'          => __( 'Previous page', 'Thermal' ),
            'next_text'          => __( 'Next page', 'Thermal' ),
            'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'Thermal' ) . ' </span>',
        ) );
    
    wp_reset_postdata();
    
    ?>
    
    

    Thank you in advance for your help.

Viewing 1 replies (of 1 total)
  • Plugin Author AlanP57

    (@alanp57)

    As you can see from the readme.txt file, it says to replace the existing pagination code, which in the Twenty Fifteen looks like this,

    the_posts_pagination( array(
      'prev_text' => __( 'Previous page', 'twentyfifteen' ),
      'next_text' => __( 'Next page', 'twentyfifteen' ),
      'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
    ) );

    And this part goes into the code that handles the pagination if WP Paginate is not available on the site:

    if(function_exists('wp_paginate')):
       wp_paginate();	
    else :
      // default patination code goes here
    endif;

    You do not need to use the default Twenty Fifteen pagination code. You can use what your custom theme used prior to installing WP Paginate.

    Note that the functions __() and the _e() are forms of the gettext() filter that is used to translate strings in WordPress. The name that goes in the second parameter is the theme’s text domain. If you do not have a text domain, then you would not need to use __() or _e(). You can learn more about gettext() from this article, https://pippinsplugins.com/introduction-gettext-filter-wordpress/

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.