• Resolved Michael

    (@kcmello)


    I just can’t get the “load more button” to appear. What have I missed? I have a real simple wordpress theme which I have coded myself.

    This is the template that I have given to page ” blog”.

    <?php
    /*
    Template Name: My Awesome Custom Page
    */
    
    get_header();?>
    <div>
    <?php
    query_posts('showposts=3');
    if (have_posts()):
        while (have_posts()):
            the_post(); ?>
    
         <a style="color:#308651;" href="<?php the_permalink();?>"> <p style="color:#308651;" id="Bowlorama_a_striking_experience"><?php the_title();?> </p></a>
    
         <p id="BREAKFAST_BOWL_8_Black_Bean_Cake_Greens_Tomato_Avocado_Pic">  <?php echo get_the_excerpt();?>
           <br> <a style="color:#308651;" href="<?php the_permalink();?>">Läs mer»</a>
        </p>
                <?php
        endwhile;
    else:
        echo '<p>no posts were found</p>';
    endif;
    ?>
    
    </div>
    <?php
    get_footer();
    ?>

    I also have a wp_head as well as a wp_footer added to my header.php/footer.php file.

    I copied [ajax_load_more] into my “blog” page. All files/maps has the read/write access enabled.

    Still, no button appear.

    https://wordpress.org/plugins/ajax-load-more/

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

    (@dcooney)

    Hi there.
    Where is the shortcode? You need to add it to the template.

    What is the code example above?

    Cheers,

    Thread Starter Michael

    (@kcmello)

    The code above is my loop to fetch out the three latest posts.
    I copied that code above and pasted it into ajax load more repeat template.
    Did I do anything wrong?

    Plugin Author Darren Cooney

    (@dcooney)

    This should be your repeater template:

    <div>
    <a href="<?php the_permalink();?>"><p><?php the_title();?> </p></a>
    <p><?php echo get_the_excerpt();?>
    <br>
    <a href="<?php the_permalink();?>">Läs mer»</a>
    </p>
    </div>
    Thread Starter Michael

    (@kcmello)

    I edited the template repeater so it is now the same code sample as you gave me above. But still, I do not find any “läs mer” button under my three latest posts, which are shown.

    My “blog” page is empty except: [ajax_load_more post_type=”post” posts_per_page=”3″ transition=”fade”]

    Is that correct?

    Plugin Author Darren Cooney

    (@dcooney)

    Ill need to see a link to provide more help.

    Thread Starter Michael

    (@kcmello)

    http://www.michaelpeyron.com, that is my page.
    And, at “nyheter” you will find my latest posts.

    Plugin Author Darren Cooney

    (@dcooney)

    Do you have wp_footer() in your footer.php file?
    Looks like ajax load more JS is not loading.

    Thread Starter Michael

    (@kcmello)

    Yes, I do.

    <?php wp_footer();?>
        </body>
    </html>

    The bottom of footer.php.

    Plugin Author Darren Cooney

    (@dcooney)

    Not sure then. the ajax-load-more.js is loaded with wp_footer and it’s not on your page.

    Thread Starter Michael

    (@kcmello)

    wp_footer(); is in footer.php which is included.
    I tried adding wp_footer(); to my blog pages as well. But no change.

    Plugin Author Darren Cooney

    (@dcooney)

    Where am I looking to find ajax load more?
    Your blog page doesn’t have the shortcode…

    Thread Starter Michael

    (@kcmello)

    http://michaelpeyron.com/blog/

    It has the code. Added it to page in wordpress dashboard.
    Is it a way to add it via the php-file?

    Plugin Author Darren Cooney

    (@dcooney)

    yes, use the do_shortcode() method.

    Thread Starter Michael

    (@kcmello)

    Sorry, Im not familiar in how the code would look like in php.

    [ajax_load_more post_type=”post” posts_per_page=”3″ transition=”fade”]

    What do I type around that code in the php-file?

    Plugin Author Darren Cooney

    (@dcooney)

    Try adding this to your template file.
    <?php echo do_shortcode('[ajax_load_more post_type="post" posts_per_page="3" transition="fade"]'); ?>

Viewing 15 replies - 1 through 15 (of 29 total)

The topic ‘What do I miss?’ is closed to new replies.