• Resolved J

    (@atypicaljb)


    Initially I posted on support sharing I was having issues getting this plugin functional.
    @dcooney helped me identify my problem.

    So since I saw the functionality of the plugin I decided to go ahead and move forward in trying to implement product.

    I have purchased the previous post addon and activated it. I have taken a portion of single.php and made it my repeater. I have used various options in the shortcode. It seems to be functioning but I am running into some minor problems that are likely on my end.

    With that you will quickly find I am not the sharpest at this stuff so please be easy on me. I’m just trying to figure this out and learn along the way.

    My two issues I am struggling to figure out are:

    1) Loading of current and newer posts from any one active post. Say I am on 2nd most recent post this post and most recent post will load below it. My desire is that only older posts will load below any selected post.

    2) The sizing seems to be off. The post selected displays properly but anything loaded below that is very narrow and title is sized down etc.

    3) I havent looked into yet but expect it will come up after resolving these problems would be the ability to view the footer without the scroll loading and thus pushing your viewing area away from the footer. ( I know you can use the button as a work around but maybe its possible to have scroll and still have ability to view footer?

    I like the way the example https://connekthq.com/ajax-load-more-posts/alm-post-example/ works. Ideally once anyone clicks a post it would function in this manner loading previous posts in the same width and layout.

    Below is the content last in place while having these issues. I am going to remove the alm shortcode from single.php again so that any visitors to the site in the meantime do not get thrown off by the mess.

    ===========================This is my single.php content================================

    <?php get_header(); ?>

    <div class=”content”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>

    <?php if ( has_post_thumbnail() ) : ?>

    <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘post-image’ ); $url = $thumb[‘0’]; ?>

    <div class=”featured-media”>

    <script type=”text/javascript”>

    jQuery(document).ready(function($) {

    $(“.featured-media”).backstretch(“<?php echo $url; ?>”);

    });

    </script>

    <?php the_post_thumbnail(‘post-image’); ?>

    <?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>

    <div class=”media-caption-container”>

    <p class=”media-caption”><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>

    </div>

    <?php endif; ?>

    </div> <!– /featured-media –>

    <?php endif; ?>

    <div class=”post-header section”>

    <div class=”post-header-inner section-inner medium”>

    <p class=”post-meta-top”>” title=”<?php the_time(‘h:i’); ?>”><?php the_time(get_option(‘date_format’)); ?> <?php if ( comments_open() ) { echo ‘<span class=”sep”>/</span> ‘; comments_popup_link( ‘0 comments’, ‘1 comment’, ‘% comments’, ‘post-comments’ ); } ?> <?php edit_post_link( ‘Edit’, ‘<span class=”sep”>/</span> ‘ ); ?></p>

    <h1 class=”post-title”><?php the_title(); ?></h1>

    </div> <!– /post-header-inner section-inner –>

    </div> <!– /post-header section –>

    <div class=”post-content section-inner thin”>

    <?php the_content(); ?>

    <div class=”clear”></div>

    <?php wp_link_pages(‘before=<p class=”page-links”>’ . __(‘Pages:’,’radcliffe’) . ‘ &after=</p>&separator=<span class=”sep”>/</span>’); ?>

    </div>

    <div class=”post-meta section-inner thin”>

    <?php previous_post_link(‘<< %link Previous‘); ?> &smashp; <?php next_post_link(‘Next %link >>‘); ?>

    <?php echo do_shortcode(‘[ajax_load_more previous_post=”true” previous_post_id=”‘.get_the_ID().'” post_type=”post” posts_per_page=”1″ offset=”1″ pause=”true” images_loaded=”true” post__not_in=”‘.$post__not_in.'”]’); ?>

    <div class=”meta-block post-author”>

    <h3 class=”meta-title”><?php _e(‘About the author’,’radcliffe’); ?></h3>

    <div class=”post-author-container”>

    <?php echo get_avatar( get_the_author_meta(’email’), ‘160’ ); ?>

    <div class=”post-author-inner”>

    <h3><?php the_author_posts_link(); ?></h3>

    <p class=”author-description”><?php the_author_meta(‘description’); ?></p>

    <div class=”author-links”>

    ” href=”<?php echo get_author_posts_url(get_the_author_meta( ‘ID’ )); ?>”><?php _e(‘Author archive’,’radcliffe’); ?>

    <?php $author_url = get_the_author_meta(‘user_url’);

    $author_url = preg_replace(‘#^https?://#’, ”, rtrim($author_url,’/’));

    if (!empty($author_url)) : ?>

    ” href=”<?php the_author_meta(‘user_url’); ?>”><?php _e(‘Author website’,’radcliffe’); ?>

    <?php endif; ?>

    </div> <!– /author-links –>

    </div>

    <div class=”clear”></div>

    </div>

    </div> <!– /post-author –>

    <div class=”meta-block post-cat-tags”>

    <h3 class=”meta-title”><?php _e(‘About the post’,’radcliffe’); ?></h3>

    <p class=”post-categories”>

    <?php the_category(‘, ‘); ?>

    </p>

    <?php if ( has_tag() ) : ?>

    <p class=”post-tags”>

    <?php the_tags(”, ‘, ‘); ?>

    </p>

    <?php endif; ?>

    <div class=”post-nav”>

    <?php
    $next_post = get_next_post();
    if (!empty( $next_post )): ?>

    <p class=”post-nav-next”>

    ” href=”<?php echo get_permalink( $next_post->ID ); ?>”><?php echo get_the_title($next_post); ?>

    </p>

    <?php endif; ?>

    <?php
    $prev_post = get_previous_post();
    if (!empty( $prev_post )): ?>

    <p class=”post-nav-prev”>

    ” href=”<?php echo get_permalink( $prev_post->ID ); ?>”><?php echo get_the_title($prev_post); ?>

    </p>

    <?php endif; ?>

    <div class=”clear”></div>

    </div> <!– /post-nav –>

    </div> <!– /post-cat-tags –>

    <div class=”clear”></div>

    </div> <!– /post-meta –>

    </div> <!– /post –>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; else: ?>

    <p><?php _e(“We couldn’t find any posts that matched your query. Please try again.”, “radcliffe”); ?></p>

    <?php endif; ?>

    </div> <!– /post –>

    </div> <!– /content –>

    <?php get_footer(); ?>

    ====================Below is my repeater content=======================================

    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>

    <?php if ( has_post_thumbnail() ) : ?>

    <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘post-image’ ); $url = $thumb[‘0’]; ?>

    <div class=”featured-media”>

    <script type=”text/javascript”>

    jQuery(document).ready(function($) {

    $(“.featured-media”).backstretch(“<?php echo $url; ?>”);

    });

    </script>

    <?php the_post_thumbnail(‘post-image’); ?>

    <?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>

    <div class=”media-caption-container”>

    <p class=”media-caption”><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>

    </div>

    <?php endif; ?>

    </div> <!– /featured-media –>

    <?php endif; ?>

    <div class=”post-header section”>

    <div class=”post-header-inner section-inner medium”>

    <p class=”post-meta-top”>” title=”<?php the_time(‘h:i’); ?>”><?php the_time(get_option(‘date_format’)); ?> <?php if ( comments_open() ) { echo ‘<span class=”sep”>/</span> ‘; comments_popup_link( ‘0 comments’, ‘1 comment’, ‘% comments’, ‘post-comments’ ); } ?> <?php edit_post_link( ‘Edit’, ‘<span class=”sep”>/</span> ‘ ); ?></p>

    <h1 class=”post-title”><?php the_title(); ?></h1>

    </div> <!– /post-header-inner section-inner –>

    </div> <!– /post-header section –>

    <div class=”post-content section-inner thin”>

    <?php the_content(); ?>

    <div class=”clear”></div>

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

    (@dcooney)

    Hi @atypicaljb,
    Sorry for the delay in responding.

    1) Loading of current and newer posts from any one active post. Say I am on 2nd most recent post this post and most recent post will load below it. My desire is that only older posts will load below any selected post.

    Previous Post add-on loads the previous post in chronological order… It doesn’t display more recent posts.

    2) The sizing seems to be off. The post selected displays properly but anything loaded below that is very narrow and title is sized down etc.

    Can you show me an example, this sounds like an issue with your containers.

    Cheers,

    Thread Starter J

    (@atypicaljb)

    No problems I haven’t had much time recently to with it.

    1) I see that it is not showing more recent posts now. It is still duplicating the post that is already being viewed. In the shortcode it is set to 1 which I thought was meant to fix this?

    Shortcode used

    <?php echo do_shortcode(‘[ajax_load_more previous_post=”true” previous_post_id=”‘.get_the_ID().’” post_type=”post” posts_per_page=”1″ offset=”1″ pause=”true” images_loaded=”true” post__not_in=”‘.$post__not_in.’”]’); ?>

    2) Here are two screen shot links to give an example.

    https://www.dropbox.com/s/ewbpkdts2k88p2x/Screenshot%202017-02-18%2013.31.07.png?dl=0

    https://www.dropbox.com/s/a51w435gumlfo5p/Screenshot%202017-02-18%2013.31.20.png?dl=0

    Thread Starter J

    (@atypicaljb)

    As an update.

    I could not sort out the issue myself so I pulled in assistance on fiverr and got it worked out.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set to only load previous posts & sizing’ is closed to new replies.