Wednesday, October 12, 2022
HomeWordPress Developmentloop - WPNavi pagination hyperlinks not engaged on {custom} pages

loop – WPNavi pagination hyperlinks not engaged on {custom} pages


I have been googling this for awhile and can not seem to discover a resolution that fixes a problem I am having:

I am utilizing WPNavi on a {custom} publish sort in an effort to show a associated content material part (i.e. to showcase printed articles that an individual has authored on the backside of their bio web page, 8 objects per web page, with the power to web page by means of all their articles). I can get the pagination to point out up on the backside of the part with the suitable variety of pages listed, however clicking on any web page does not change the URL (i.e., “person-name/web page/2” and many others.) nor change the show of associated content material. What am I doing fallacious?

Code:

    <?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
  'post_type' => array('publish','occasions'),
  'posts_per_page' => 8,
  'paged' => $paged,
  'meta_query' => array(
    'relation' => 'OR',
    array(
      'key' => 'creator',
      'worth' => '"' . get_the_ID() . '"',
      'examine' => 'LIKE'
    ),
    array(
      'key' => 'related_people',
      'worth' => '"' . get_the_ID() . '"',
      'examine' => 'LIKE'
    )
  )
); $my_query = new WP_Query($args); ?>
<?php
 if ($my_query->have_posts()) : ?>
<part id="associated" class="category__posts grid-container">

  <div class="category__posts-inner grid-x grid-padding-x">

    <div class="category__posts-content cell">

      <h3><?php _e('Associated Content material','igcc-custom'); ?></h3>

      <div class="category__posts-grid grid-x grid-padding-x">

      <?php whereas ($my_query->have_posts()) : $my_query->the_post();
        get_template_part('elements/loop','associated');
      endwhile; echo '<div class="pagination">';

              if (function_exists('wp_pagenavi')) {
                wp_pagenavi( array( 'question' => $my_query ) );
              }
              echo '</div>'; wp_reset_query();
            endif;

 ?>

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments