title: Loop Pagination and Categories in CPT on Ultimate Member Custom Tabs
body: <p>I have created a custom tab in UM and then a shortcode that loads a loop of a cpt called <code>&quot;orders&quot;</code> for each profile author, it works perfectly but it needs a pagination and the function <code>get_the_post_navigation()</code> shows the previous and next page and I sends to posts but doesn't show page numbering and that's what I need when I define <code>'posts_per_page' =&gt; 6</code>
  What I need is a pagination with numbering that depends on the <code>'posts_per_page'</code> like the example:</p>
  <pre><code>Previous page 1 2 3 ... 20 Next page
  </code></pre>
  <p>The categories are shown in the meta data at the bottom of each post orders, just as it is done in the posts and it is that in the posts I show it easily with <code>the_category(', ')</code> but in the CPT of orders this does not work. Here is an example of how it should look:</p>
  <pre><code>Joe Doe • 2022/3/3 • Cat1, Cat2 • 1 Comment • Edit
  </code></pre>
  <p><em>Categories link to the Cat1 or Cat2 archive just like post categories</em></p>
  <p>Here is the code for the custom tab:</p>
  <pre><code>function um_mycustomtab_add_tab( $tabs ) {
      $tabs['orderstab'] = array(
          'name'            =&gt; 'Orders',
          'icon'            =&gt; 'um-icon-android-mail',
          'custom'          =&gt; true
      );
      if ( !isset( UM()-&gt;options()-&gt;options['profile_tab_' . 'orderstab'] ) ) {
          UM()-&gt;options()-&gt;update( 'profile_tab_' . 'orderstab', true );
      }
      return $tabs;
  }
  add_filter( 'um_profile_tabs', 'um_mycustomtab_add_tab', 1000 );
  function um_profile_content_orderstab( $args ) {
      echo do_shortcode('[um_cpt_orders]');
  }
  add_action( 'um_profile_content_orderstab', 'um_profile_content_orderstab' );
  </code></pre>
  <p>Here I leave the code of the shortcode:</p>
  <pre><code>add_shortcode( 'um_cpt_orders', function () {
      $profile_id = um_profile_id();  
      $args = array(
          'post_type' =&gt; array('orders'),
          'post_status' =&gt; array('publish'),
          'posts_per_page' =&gt; 6,
          'author' =&gt; $profile_id
      );  
      $the_query = new WP_Query( $args );
      ob_start();
      if ( $the_query-&gt;have_posts() ) {
          echo '&lt;ul&gt;';
          while ( $the_query-&gt;have_posts() ) {
              $the_query-&gt;the_post();
              echo '&lt;li&gt;' . get_the_title() . '&lt;/li&gt;';
          }
          echo '&lt;/ul&gt;';
      } else {
      echo 'No orders found';
      }
      wp_reset_postdata();
      $contents = ob_get_contents();
      ob_end_clean();
      return $contents;
  } );
  </code></pre>
  <p>Everything works fine, you only need pagination and the cpt categories since many posts can be put together in a short time.</p>
  <p>A big greeting and I hope that this code can also help more people, since you can also load posts and make them more complete than the ones that UM brings, thank you very much.</p>