• Hello! I really like the look of your plugin and I’ve been trying to implement it to my site but I cannot get it to work since I’m not too familiar with coding.

    I want to enable it only on my front home page where it is set to show the latest posts.
    Could you please assist me?

    Here’s the front-page.php of my theme (Arcade Theme):

    <?php
    /**
     * The front page template.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @since 1.0.0
     */
    get_header();
    
    global $paged;
    $bavotasan_theme_options = bavotasan_theme_options();
    
    if ( 2 > $paged ) {
    	// Display jumbo headline is the option is set
    	if ( is_active_sidebar( 'jumbo-headline' ) || ! empty( $bavotasan_theme_options['jumbo_headline_title'] ) ) {
    	?>
    	<div class="home-top">
    		<div class="container">
    			<div class="row">
    				<div class="col-md-12">
    					<?php
    					if ( is_active_sidebar( 'jumbo-headline' ) ) {
    						dynamic_sidebar( 'jumbo-headline' );
    					} else {
    						?>
    						<div class="home-jumbotron jumbotron">
    							<h2><?php echo apply_filters( 'the_title', html_entity_decode( $bavotasan_theme_options['jumbo_headline_title'] ) ); ?></h2>
    							<p><?php echo wp_kses_post( html_entity_decode( $bavotasan_theme_options['jumbo_headline_text'] ) ); ?></p>
    							<?php if ( ! empty( $bavotasan_theme_options['jumbo_headline_button_text'] ) ) { ?>
    							<a class="btn btn-lg btn-<?php echo esc_attr( $bavotasan_theme_options['jumbo_headline_button_color'] ); ?>" href="<?php echo esc_url( $bavotasan_theme_options['jumbo_headline_button_link'] ); ?>"><?php echo strip_tags( html_entity_decode( $bavotasan_theme_options['jumbo_headline_button_text'] ) ); ?></a>
    							<?php } ?>
    						</div>
    						<?php
    					}
    					?>
    				</div>
    			</div>
    		</div>
    	</div>
    	<?php
    	}
    
    	// Display home page top widgetized area
    	if ( is_active_sidebar( 'home-page-top-area' ) ) {
    		?>
    		<div id="home-page-widgets">
    			<div class="container">
    				<div class="row">
    					<?php dynamic_sidebar( 'home-page-top-area' ); ?>
    				</div>
    			</div>
    		</div>
    		<?php
    	}
    }
    if ( 'page' == get_option('show_on_front') ) {
    	include( get_page_template() );
    } else {
    ?>
    	<div class="container">
    		<div class="row">
    			<div id="primary" <?php bavotasan_primary_attr(); ?>>
                    <?php
    				if ( have_posts() ) {
    					while ( have_posts() ) : the_post();
    						get_template_part( 'content', get_post_format() );
    					endwhile;
    
    					bavotasan_pagination();
    				} else {
    					if ( current_user_can( 'edit_posts' ) ) {
    						// Show a different message to a logged-in user who can add posts.
    						?>
    						<article id="post-0" class="post no-results not-found">
    							<h1 class="entry-title"><?php _e( 'Nothing Found', 'arcade' ); ?></h1>
    
    							<div class="entry-content description clearfix">
    								<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'arcade' ), admin_url( 'post-new.php' ) ); ?></p>
    							</div><!-- .entry-content -->
    						</article>
    						<?php
    					} else {
    						get_template_part( 'content', 'none' );
    					} // end current_user_can() check
    				}
    				?>
    			</div><!-- #primary.c8 -->
    			<?php get_sidebar(); ?>
    		</div>
    	</div>
    
    <?php
    }
    get_footer(); ?>

    Thank you!

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

    (@dcooney)

    Hi @catmaniax,
    I think it might be as simple as this.

    <?php
    /**
     * The front page template.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @since 1.0.0
     */
    get_header();
    
    global $paged;
    $bavotasan_theme_options = bavotasan_theme_options();
    
    if ( 2 > $paged ) {
    	// Display jumbo headline is the option is set
    	if ( is_active_sidebar( 'jumbo-headline' ) || ! empty( $bavotasan_theme_options['jumbo_headline_title'] ) ) {
    	?>
    	<div class="home-top">
    		<div class="container">
    			<div class="row">
    				<div class="col-md-12">
    					<?php
    					if ( is_active_sidebar( 'jumbo-headline' ) ) {
    						dynamic_sidebar( 'jumbo-headline' );
    					} else {
    						?>
    						<div class="home-jumbotron jumbotron">
    							<h2><?php echo apply_filters( 'the_title', html_entity_decode( $bavotasan_theme_options['jumbo_headline_title'] ) ); ?></h2>
    							<p><?php echo wp_kses_post( html_entity_decode( $bavotasan_theme_options['jumbo_headline_text'] ) ); ?></p>
    							<?php if ( ! empty( $bavotasan_theme_options['jumbo_headline_button_text'] ) ) { ?>
    							<a class="btn btn-lg btn-<?php echo esc_attr( $bavotasan_theme_options['jumbo_headline_button_color'] ); ?>" href="<?php echo esc_url( $bavotasan_theme_options['jumbo_headline_button_link'] ); ?>"><?php echo strip_tags( html_entity_decode( $bavotasan_theme_options['jumbo_headline_button_text'] ) ); ?></a>
    							<?php } ?>
    						</div>
    						<?php
    					}
    					?>
    				</div>
    			</div>
    		</div>
    	</div>
    	<?php
    	}
    
    	// Display home page top widgetized area
    	if ( is_active_sidebar( 'home-page-top-area' ) ) {
    		?>
    		<div id="home-page-widgets">
    			<div class="container">
    				<div class="row">
    					<?php dynamic_sidebar( 'home-page-top-area' ); ?>
    				</div>
    			</div>
    		</div>
    		<?php
    	}
    }
    if ( 'page' == get_option('show_on_front') ) {
    	include( get_page_template() );
    } else {
    ?>
    	<div class="container">
    		<div class="row">
    			<div id="primary" <?php bavotasan_primary_attr(); ?>>
                <?php echo do_shortcode('[ajax_load_more']); ?>
    			</div>
    			<?php get_sidebar(); ?>
    		</div>
    	</div>
    
    <?php
    }
    get_footer(); ?>
    Thread Starter catmaniax

    (@catmaniax)

    Thanks for the reply. I get an error though on line 67:

    <?php echo do_shortcode(‘[ajax_load_more’]); ?>

    Also, what do I need to fill in the plugin’s options page?

    Plugin Author Darren Cooney

    (@dcooney)

    What’s the error you are getting?

    Also, what do I need to fill in the plugin’s options page?
    Please have a look at the documentation on the website and in the plugin itself.

    Thread Starter catmaniax

    (@catmaniax)

    That line just breaks the site (Parse error: syntax error, unexpected ‘]’).
    Could you please help me with it?
    Also, which Container Type of the two I should choose and what should I fill in the Container Classes?
    As I said I only need it for my front home page as it is set to show the latest posts.

    Here’s the link to live demo of the theme if it’s any help:
    http://demos.bavotasan.com/arcade/

    Thanks again!

    The ‘ and ] are the wrong way round; try:

    <?php echo do_shortcode('[ajax_load_more]'); ?>

    Thread Starter catmaniax

    (@catmaniax)

    Thanks, that did the trick.
    However, it appears that the plugin changes the style of the posts and I don’t want that.
    Is there a way to keep the default style?

    Here’s the comparison.

    The original default:
    http://s17.postimg.org/wm7p7gshb/default.jpg

    With Ajax Load More:
    http://s4.postimg.org/3wshoi4bx/ajax.jpg

    Please let me know because I’d really like to use your plugin!
    Thanks!

    Plugin Author Darren Cooney

    (@dcooney)

    Visit Ajax Load More > Setting and check ‘I want to use my own CSS styles.’ This will disable all Ajax Load More styles.

    Thread Starter catmaniax

    (@catmaniax)

    I already tried that but it still changes the CSS.
    Here’s a screenshot with that option enabled:

    http://s10.postimg.org/v36dq4rkp/Capture.jpg

    Plugin Author Darren Cooney

    (@dcooney)

    Your markup must be incorrect.
    Make sure you are using the correct container type (ul, div) and the correct markup in your repeater template

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Cannot get it to work!’ is closed to new replies.