Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 28th May 2013, 01:04 AM   #1
Banned
 
Join Date: 2011
Posts: 1,181
Thanks: 392
Thanked 155 Times in 137 Posts
Default
Could Someone Please Help me with Infinite Scroll WP Plugin?
Share on: 
fb share twitter share gplus share more share

I am experiencing a lot of frustration trying to get this to work. I'm trying to get the infinite scroll plugin on WordPress to work with my current theme.

I've tried everything. The plugin asks you to name the selectors you use on your site. I've tried everything and it is still not working. There is no change in my site whatsoever when I activate the plugin, or when I change the settings.

I do have JetPack installed.

There must be something simple I am missing, because when I read other people installing on their own sites, they say it is very simple.

Anyways,

This is my index.php code:

Code:
<?php get_header(); ?>

<div id="content">
				<?php
				$current_page = get_query_var('paged');
				$hide_carousel = ( $current_page && isset($theme_options['lightly_homepage_headline_slider_hide']) && $theme_options['lightly_homepage_headline_slider_hide']);
				if ( $theme_options['lightly_homepage_headline_slider'] && !($hide_carousel) ) {
					if ( isset($theme_options['lightly_headline_posts_categories']) && $theme_options['lightly_headline_posts_categories'] ) $cats = implode(',', $theme_options['lightly_headline_posts_categories'] );
					else $cats = '';
					$args = array('cat' => $cats, 'showposts' => $theme_options['lightly_headline_posts_number'] );
				?>	



<div id="headline-carousel">
                	<?php
					plus62_custom_loop_posts( $args ,$theme_options['lightly_headline_posts_title'] );
					?>
</div>

<?php } ?>



<div id="main" role="main">
						
						<h4 class="widgettitle"><span>Recent Posts</span></h4>
						<?php if (have_posts()) : $i = 1; while ( have_posts() ) : the_post(); ?>

<div id="post">
								<?php if (has_post_thumbnail()): ?>
								<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="home-thumb"><?php the_post_thumbnail('thumb-300'); ?></a>
								
								<?php endif; ?>




							<header>
<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<p class="meta"> <time datetime="<?php echo the_time('Y-m-d'); ?>"><?php the_time('m/d/Y'); ?></time>, <?php the_author_posts_link(); ?></p>
							</header> <!-- end article header -->



							<section class="post_content clearfix">
								<?php the_excerpt(); ?>
								<p class="read-more"><a href="<?php the_permalink() ?>"><?php _e('Read Post &rarr;', 'plus62'); ?></a></p>
							</section> <!-- end article section -->							
						
						</div> <!-- end article -->
						
						
						<?php endwhile; ?>	
						
						<?php 
							if (function_exists('plus62_pagenavi')) { 
									plus62_pagenavi();
							} else { // if it is disabled, display regular wp prev & next links ?>

							<nav class="wp-prev-next">
								<ul class="clearfix">
									<li class="prev-link"><?php next_posts_link(__('&laquo; Older Entries', 'plus62')) ?></li>
									<li class="next-link"><?php previous_posts_link(__('Newer Entries &raquo;', 'plus62')) ?></li>
								</ul>
							</nav>
						<?php } ?>		
						
						<?php else : ?>
						
						<article id="post-not-found">
						    <header>
						    	<h1>Not Found</h1>
						    </header>
						    <section class="post_content">
						    	<p>Sorry, but the requested resource was not found on this site.</p>
						    </section>
						    <footer>
						    </footer>
						</article>
						
						<?php endif; ?>
					
					</div> <!-- end #main -->
				
					
				
    
			</div> <!-- end #content -->

<?php get_footer(); ?>

Infinite Scroll Settings is asking for the following selectors:

1. Content Selector -Div containing your theme's content
2. Navigation Selector -Div containing your theme's navigation
3. Next Selector -Link to next page of content
4. Item Selector -Div containing an individual post

I currently have the settings as:

1. #main
2. .page-navigation
3. .page-numbers .next
4. #post

Are these correct? Am I supposed to add something to my functions.php file? Or am I supposed to add something to my index.php, replacing my current page-navi?

Is there anyone that could help me, please?

Thank you
lovboa is offline  
Unread 29th May 2013, 07:13 PM   #2
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Could Someone Please Help me with Infinite Scroll WP Plugin?
Share on: 
fb share twitter share gplus share more share

The theme is coded incorrectly, and won't work with Jetpack's Infinite Scroll.

Do you see where it says, '<div id="post">? That is one of the killers. That line is within the 'WordPress Loop' - meaning that for every post that is displayed, that whole section is repeated.

The problem is that container id's must be unique. In other words, the id 'post' can only be used once.

It's likely that the javascript that runs the scroll is choking on the incorrect id's. Get that fixed then try again. Change 'id="post"' to a class instead, such as 'class="entry"'.

As for your list:
#1 - should be ok
#2 - can't tell, because your main nav container is probably in the header
#3 - should be li.next-link
#4 - should be whatever you change the article container to (I recommend against 'post' as that class is used in other areas of WP themes).
SteveJohnson is offline  
The Following User Says Thank You to SteveJohnson For This Useful Post:
Closed Thread


Bookmarks

Tags
infinite, plugin, scroll


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 05:10 PM.