• Resolved nirav257

    (@nirav257)


    Hello,

    I have an Issues in my wordpress website. I Create Custom theme site. I added Load More button in blog post page but currently not show load more button in my site. Site link mention in top.

    Please help out…

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator bcworkz

    (@bcworkz)

    Exactly how and where did you add this button? There could be an error in how this was accomplished. Or caching could be at play. You may have done everything right, but your server is serving old, cached content. If you have any server side caching active, the caches should be flushed.

    Faisal Ahammad

    (@faisalahammad)

    Hi @nirav257

    I’ve checked your blog page and didn’t find any “Load More” button there. If you’ve already hidden or removed it, please restore it so we can check and assist you.

    Thread Starter nirav257

    (@nirav257)

    Hello @faisalahammad

    Button Code Place in Temaplate File but didn’t show in Frontend side. what is the issues I Don’t Find us. Show code in below image..

    Faisal Ahammad

    (@faisalahammad)

    Hey @nirav257

    It looks like your Load More button isn’t showing because the $blog_query variable might not be properly set or initialized. This part of your code relies on $blog_query->max_num_pages being greater than 1. If this variable is empty, missing, or set elsewhere, the button won’t appear.

    Please ensure that $blog_query is defined in the same template file and is using WP_Query. A typical example would be:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
      'post_type' => 'post',
      'posts_per_page' => 10,
      'paged' => $paged
    );
    $blog_query = new WP_Query($args);

    Add this before the Load More button code. Also, consider printing the value of $blog_query->max_num_pages temporarily to confirm it’s working.

    Give it a try, and let me know how that goes! 😄

    Thread Starter nirav257

    (@nirav257)

    hi @faisalahammad

    it’s not working in site.

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      $args = array(
      'post_type' => 'post',
      'post_status' => 'publish',
       'nopaging' => false,
      'posts_per_page' => get_option('posts_per_page'),
      'paged'=> 'paged',
      'orderby' => array(
            'menu_order' => 'ASC',
            'date' => 'DESC',
      )
    );
    $blog_query = new WP_Query( $args );
    Faisal Ahammad

    (@faisalahammad)

    Hey @nirav257

    From what you’ve shared, it’s tricky to pinpoint the exact issue without seeing the full code in context. At this point, I recommend using an AI tool that can help you review the full code, or getting in touch with a developer who can check the entire setup of your theme and see what might be going wrong.

    They’ll be able to look at the interactions between different template files and scripts, which is hard to do without complete access.

    Thread Starter nirav257

    (@nirav257)

    hi @faisalahammad

    I Will share code please help me out. please share your email id.

    Moderator threadi

    (@threadi)

    According to the forum guidelines, it is not desired to share such contact information. I would recommend that you make the source code available on GitHub or Gists, for example.

    Thread Starter nirav257

    (@nirav257)

    Hello

    Problem was solved. Thank you for helping…

    • This reply was modified 12 months ago by nirav257.
Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Blog post load more button Issues’ is closed to new replies.