• Hello there,

    I tried using your plugin to enable ajax lazy load instead of pagination for my archive pages, I am using generatepress theme, I copied template from theme single.php file and pasted in plugin repeater template. It does the job but design is little bit different, each snippet box design is missing. I checked source code through inspect element of archive page & found this code

    <div id="ajax-load-more" class="ajax-load-more-wrap blue alm-0" data-id="1" data-alm-id="0" data-canonical-url="https://pageurl" data-slug="director" data-post-id="66" data-localized="ajax_load_more_1_vars" data-total-posts="492"><div aria-live="polite" aria-atomic="true" class="alm-listing alm-ajax" data-container-type="div" data-loading-style="blue" data-archive="true" data-repeater="default" data-post-type="post" data-taxonomy="category" data-taxonomy-terms="director" data-taxonomy-operator="IN" data-order="DSC" data-orderby="date" data-offset="10" data-posts-per-page="10" data-scroll="false" data-pause="true" data-button-label="Load More"><div class="alm-reveal" style="opacity: 1; height: auto; outline: none;">
    Due to which design is not proper.

    One more thing items like date, category, tag is also missing from post snippet.

    Can you tell me how to solve these two issues.

    • This topic was modified 2 years, 5 months ago by manav kalra.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    @manavkalra15 Here is a link to a single.php file users who are using the Single Post add-on use.
    https://connekthq.com/plugins/ajax-load-more/docs/add-ons/single-posts/#generatepress

    I don’t know if you are using the addon or not.

    I copied template from theme single.php file and pasted in plugin repeater template.

    This doesn’t like a good idea. you would only copy the repeatable code.

    Thread Starter manav kalra

    (@manavkalra15)

    Sorry @dcooney,

    By mistake I wrote single.php, I copied repetable code from content.php

    This code I copied from content.php

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
    	<div class="inside-article">
    		<?php
    		/**
    		 * generate_before_content hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_featured_page_header_inside_single - 10
    		 */
    		do_action( 'generate_before_content' );
    
    		if ( generate_show_entry_header() ) :
    			?>
    			<header <?php generate_do_attr( 'entry-header' ); ?>>
    				<?php
    				/**
    				 * generate_before_entry_title hook.
    				 *
    				 * @since 0.1
    				 */
    				do_action( 'generate_before_entry_title' );
    
    				if ( generate_show_title() ) {
    					$params = generate_get_the_title_parameters();
    
    					the_title( $params['before'], $params['after'] );
    				}
    
    				/**
    				 * generate_after_entry_title hook.
    				 *
    				 * @since 0.1
    				 *
    				 * @hooked generate_post_meta - 10
    				 */
    				do_action( 'generate_after_entry_title' );
    				?>
    			</header>
    			<?php
    		endif;
    
    		/**
    		 * generate_after_entry_header hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_post_image - 10
    		 */
    		do_action( 'generate_after_entry_header' );
    
    		$itemprop = '';
    
    		if ( 'microdata' === generate_get_schema_type() ) {
    			$itemprop = ' itemprop="text"';
    		}
    
    		if ( generate_show_excerpt() ) :
    			?>
    
    			<?php
    		endif;
    
    		/**
    		 * generate_after_entry_content hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_footer_meta - 10
    		 */
    		do_action( 'generate_after_entry_content' );
    
    		/**
    		 * generate_after_content hook.
    		 *
    		 * @since 0.1
    		 */
    		do_action( 'generate_after_content' );
    		?>
    	</div>
    </article>
    Plugin Author Darren Cooney

    (@dcooney)

    @manavkalra15 Sorry – I’m not really sure since the base plugin isn’t built to support complete articles I’m not sure why some data is not appearing.

    Could be an issue with the GeneratePress hooks not realizing this is a single post template.

    Do you have the Single Posts add-on? GeneratePress is supported with this.

    Thread Starter manav kalra

    (@manavkalra15)

    @dcooney, I don’t want to add infinite scroll on my single posts. I want to add infinite scroll on archive pages (category, tags, author) instead of pagination.
    I think you misunderstood.

    Plugin Author Darren Cooney

    (@dcooney)

    In your OP you said

    I copied template from theme single.php file

    so I assumed you meant single posts.

    Have a look at the content.php template

    Thread Starter manav kalra

    (@manavkalra15)

    This is I copied from content.php

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
    	<div class="inside-article">
    		<?php
    		/**
    		 * generate_before_content hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_featured_page_header_inside_single - 10
    		 */
    		do_action( 'generate_before_content' );
    
    		if ( generate_show_entry_header() ) :
    			?>
    			<header <?php generate_do_attr( 'entry-header' ); ?>>
    				<?php
    				/**
    				 * generate_before_entry_title hook.
    				 *
    				 * @since 0.1
    				 */
    				do_action( 'generate_before_entry_title' );
    
    				if ( generate_show_title() ) {
    					$params = generate_get_the_title_parameters();
    
    					the_title( $params['before'], $params['after'] );
    				}
    
    				/**
    				 * generate_after_entry_title hook.
    				 *
    				 * @since 0.1
    				 *
    				 * @hooked generate_post_meta - 10
    				 */
    				do_action( 'generate_after_entry_title' );
    				?>
    			</header>
    			<?php
    		endif;
    
    		/**
    		 * generate_after_entry_header hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_post_image - 10
    		 */
    		do_action( 'generate_after_entry_header' );
    
    		$itemprop = '';
    
    		if ( 'microdata' === generate_get_schema_type() ) {
    			$itemprop = ' itemprop="text"';
    		}
    
    		if ( generate_show_excerpt() ) :
    			?>
    
    			<?php
    		endif;
    
    		/**
    		 * generate_after_entry_content hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_footer_meta - 10
    		 */
    		do_action( 'generate_after_entry_content' );
    
    		/**
    		 * generate_after_content hook.
    		 *
    		 * @since 0.1
    		 */
    		do_action( 'generate_after_content' );
    		?>
    	</div>
    </article>
    Plugin Author Darren Cooney

    (@dcooney)

    And?

    Plugin Author Darren Cooney

    (@dcooney)

    Thread Starter manav kalra

    (@manavkalra15)

    I am not getting Post Date, author, category, tag. I am only getting title, featured image & excerpt. One thing more I am not getting boxed layout for each post snippet.

    Update:

    Got boxed layout by adding additional css:
    .alm-reveal article{
    margin-bottom: 20px;
    }

    But still post snippet items not showing including post date, author, category, tags & leave a comment

    • This reply was modified 2 years, 5 months ago by manav kalra.
    Plugin Author Darren Cooney

    (@dcooney)

    I’m just not sure @manavkalra15. It’s working for me in multiple GeneratePress instances. Might be a theme specific hook causing problems.

    Thread Starter manav kalra

    (@manavkalra15)

    Hi @dcooney,

    Can you provide any url where we can see items (date, author, category, tags & leave a comment) in list ?

    Thread Starter manav kalra

    (@manavkalra15)

    Any update ?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Items missing in post snippet and design different’ is closed to new replies.