• Resolved pashka_z

    (@pashka_z)


    Say, please can i load posts on click, not on scroll, if can
    say please, why it doesn’t work:

    <div class=”container-fluid block-posts”>
    <div class=”content”>

    <div class=”row”>

    <?php if (have_posts()): while(have_posts()):the_post();
    echo do_shortcode(“[ajax_load_more]”);
    endwhile;
    else:
    endif;
    ?>
    </div>
    </div>
    </div>

    Appear div id=”ajax-load-more” without content

    https://www.ads-software.com/plugins/ajax-load-more/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Might be because you have the shortcode inside a loop.
    Try this instead.

    <div class="container-fluid block-posts">
    <div class="content">
    <div class="row">
    <?php
    echo do_shortcode("[ajax_load_more]");
    ?>
    </div>
    </div>
    </div>
    Thread Starter pashka_z

    (@pashka_z)

    try without
    nothing changed

    Plugin Author Darren Cooney

    (@dcooney)

    can you share more details please…
    a link maybe?

    Thread Starter pashka_z

    (@pashka_z)

    <div class="col-xs-12 col-sm-6 col-md-4">
                                        <div id="load-content" class="post-preview fadeIn wow animated" data-wow-delay="200ms" style="visibility: visible; animation-delay: 200ms; animation-name: fadeIn;">
                                            <?the_post_thumbnail('thumbnail')?>
    
                                                <div class="text-box">
                                                    <p class="title">
                                                        <a href="<? echo get_permalink()?>">
                                                            <?php the_title()?>
                                                        </a>
                                                    </p>
    
                                                    <p class="text">
                                                        <?php echo get_the_excerpt()?>
                                                    </p>
                                                    <a href="<? echo get_permalink()?>" class="button-read">Read</a>
                                                </div>
    
                                        </div>
                                    </div>

    It is Default Template
    and this code was in loop before

    Thread Starter pashka_z

    (@pashka_z)

    it’s on a localserver, sorry, what info you need?

    Plugin Author Darren Cooney

    (@dcooney)

    Can you confirm the ajax load more js is on the page?

    If it’s not returning any results than you either:

    1. have no posts
    2. set it up incorrectly.
      Thread Starter pashka_z

      (@pashka_z)

      https://take.ms/2Gpee – it is what creates
      i have 7 posts

      Plugin Author Darren Cooney

      (@dcooney)

      must be a javascript issue then. without being able to view your site I can’t really help other than what I’ve already covered.

      Did you confirm the ajax load more js is on the page?

      Thread Starter pashka_z

      (@pashka_z)

      where i can check it?
      sorry i am noob

      Plugin Author Darren Cooney

      (@dcooney)

      Look near the footer of your page.

      ajax-load-more.min.js

      Thread Starter pashka_z

      (@pashka_z)

      there is no

      Plugin Author Darren Cooney

      (@dcooney)

      Ok then you need to add <?php wp_footer(); ?> to your footer.php file

      Thread Starter pashka_z

      (@pashka_z)

      add <?php wp_footer(); ?> to the footer.php
      but nothing change https://take.ms/hHNNU

      Plugin Author Darren Cooney

      (@dcooney)

      Then Im not sure… sorry about that.

      Thread Starter pashka_z

      (@pashka_z)

      maybe something in config
      my task:
      make load more button that will be load more preview posts
      i add code, that was in loop to template
      i add shortcode to index.php
      but when i add it with more arguments

      <?php
                          echo do_shortcode("[ajax_load_more post_type="post, page" pause="true"]");
                          ?>

      Error:
      Parse error: syntax error, unexpected T_STRING

    Viewing 15 replies - 1 through 15 (of 19 total)
    • The topic ‘Why it doesn't work’ is closed to new replies.