• Resolved davidhollenbeck42

    (@davidhollenbeck42)


    Hello, I am experiencing a bug where the See More button does not go away after all the posts have been loaded. Is there something wrong with my code, or is this an issue with the plugin? Thanks!

    Site: http://www.basispulse.com

    Template Code:

    <?php
    global $post;
    $desktop_tablet_featured_image_id = get_post_meta($post->ID, 'desktop_tablet_featured_image', true);
    $desktop_tablet_featured_image = wp_get_attachment_image_src($desktop_tablet_featured_image_id, 'full');
    ?>
    <div class="col-sm-3 post-link-ajax">
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
        <img src="<?php bloginfo('template_url'); ?>/images/rollover-read-more.png" class="featured-image-more" />
        <img src="<?php echo $desktop_tablet_featured_image[0]; ?>" alt="" class="featured-image" />
        <h2><?php the_title(); ?></h2>
      </a>
    </div>

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

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

    (@dcooney)

    Can you try to move:

    <?php
    global $post;
    $desktop_tablet_featured_image_id = get_post_meta($post->ID, 'desktop_tablet_featured_image', true);
    $desktop_tablet_featured_image = wp_get_attachment_image_src($desktop_tablet_featured_image_id, 'full');
    ?>

    Into

    <div class="col-sm-3 post-link-ajax">
    <?php
    global $post;
    $desktop_tablet_featured_image_id = get_post_meta($post->ID, 'desktop_tablet_featured_image', true);
    $desktop_tablet_featured_image = wp_get_attachment_image_src($desktop_tablet_featured_image_id, 'full');
    ?>

    Thread Starter davidhollenbeck42

    (@davidhollenbeck42)

    Tried it but still not working, anything else it might be?

    <div class="col-sm-3 post-link-ajax">
    <?php
    global $post;
    $desktop_tablet_featured_image_id = get_post_meta($post->ID, 'desktop_tablet_featured_image', true);
    $desktop_tablet_featured_image = wp_get_attachment_image_src($desktop_tablet_featured_image_id, 'full');
    ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
        <img src="<?php bloginfo('template_url'); ?>/images/rollover-read-more.png" class="featured-image-more" />
        <img src="<?php echo $desktop_tablet_featured_image[0]; ?>" alt="" class="featured-image" />
        <h2><?php the_title(); ?></h2>
      </a>
    </div>
    Plugin Author Darren Cooney

    (@dcooney)

    Does the button disable after the last click though?

    EDIT – nevermind you posted a link!

    Plugin Author Darren Cooney

    (@dcooney)

    The issue is you need to style the .done class of the button.

    Thread Starter davidhollenbeck42

    (@davidhollenbeck42)

    When all posts have loaded, I can click the button and it doesn’t do anything, if that’s what you mean. But it still appears on the page which is a problem for me. Is there a CSS rule I can edit or something?

    Plugin Author Darren Cooney

    (@dcooney)

    You need to either use the css that ships with the plugin or create your own styling of the ‘done’ class that gets added to the button.
    https://www.dropbox.com/s/onnxfta1rh7rqyp/Screenshot%202015-09-29%2016.43.42.png?dl=0

    Thread Starter davidhollenbeck42

    (@davidhollenbeck42)

    I have it styled as
    button.done {display:none !important;} and it is still showing up, am I getting the path to the class wrong? Previously I had tried #ajax-load-more div.alm-btn-wrap button#load-more.alm-load-more-btn.more.done {display:none!important;} and it also didn’t work.

    David

    Thread Starter davidhollenbeck42

    (@davidhollenbeck42)

    Figured it out, thanks!

    Thread Starter davidhollenbeck42

    (@davidhollenbeck42)

    #posts button.alm-load-more-btn.done {display:none;} was the code I used for anyone who has the same problem. You may not need the #posts, I think that only applies to my site.

    David

    Plugin Author Darren Cooney

    (@dcooney)

    Good to hear!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Button will not go away after posts have been loaded’ is closed to new replies.