Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress plugin not loading more than to page 2 #53

Closed
adriantomic opened this issue Jun 16, 2011 · 17 comments
Closed

WordPress plugin not loading more than to page 2 #53

adriantomic opened this issue Jun 16, 2011 · 17 comments
Milestone

Comments

@adriantomic
Copy link

Great plugin, but I have a problem:

When I use the infinite scroll on my WordPress theme, it only loads until page 2. Even though there are more posts on page 3 and 4 etc...

Without the plugin, there are navigation links to all the pages and they work, but infinite scroll seems to ignore the links after page 2.

My theme uses the original Twenty-Ten loop.php.

Thankful for your help.

@samcleaver
Copy link
Contributor

I'll be rewriting the plugin this week or next as it's using a very old version of infinite-scroll. I'll make sure its tested on the original etc.

@ghost ghost assigned samcleaver Jun 16, 2011
@adriantomic
Copy link
Author

Cool, thanks for the quick reply :)

@lukeshumard
Copy link
Contributor

Could you post a link to a live example we could look at? It would be really helpful!

@adriantomic
Copy link
Author

It's on my own server at the moment. You can look at it here: http://1-2-3.dyndns.org/

As you can see I'm using jquery.cycle plugin. I've tried disabling it, but infinite scroll still don't load further than page 2.

Here's the loop.php: http://pastebin.com/Civ3n8xS

@adriantomic
Copy link
Author

Accidentally closed it...

@lukeshumard
Copy link
Contributor

I think you need to use the pathParse feature. It says there's no more pages to get because it's trying to go to 'http://1-3-3.dyndns.org/page/2/'.

Could you set debug to true in your options? Thanks.

@adriantomic
Copy link
Author

I think I've turned debugging on now. I'm using the WordPress plugin, så I can't change it in WP-Admin. I changed the debug setting in wp_infinite_scroll.php.

If I understand correctly, is it the actual numbers in "1-2-3.dyndns.org" that makes the plugin misunderstand the paging?

@lukeshumard
Copy link
Contributor

Thanks for that! You need to use the pathParse feature to return the array of ```['http://1-2-3.dyndns.org/page/','/']

@adriantomic
Copy link
Author

Thank you for your help. I am sorry, but I have no idea on how to use the pathParse option. I can see in the debug that the url is "split" in the wrong place. But I don't know what to write for the path parse to return the correct array.

I tried to look at the infinite scroll web site, as well as google, but I couldn't find any description on how to use it.

@lukeshumard
Copy link
Contributor

FYI, I don't know if the current WP has support for pathParse. If it doesn't, @Beaver6813 should have you covered soon.

You just need to return the array above. Try adding this to your options.

pathParse: function() {
    return ['http://1-2-3.dyndns.org/page/','/']
}

@adriantomic
Copy link
Author

Thanks. That's what I tried. It seems to return the same array as before. I can wait for @Beaver6813 to cover it :) In the meantime I will try to fix it. Cheers!

@samcleaver
Copy link
Contributor

At the moment the plugin doesn't do much more than insert and initiate infinite-scroll on the wordpress site. Seeing as its a plugin I'll just use wordpress's "current page" variable to feed it directly to the javascript, save the faffing with pathParse. The aim of infinite-scroll is to be as flexible and extensible as possible; the aim of the wp plugin is to work as easily and with as minimal configuration as possible.

@24K
Copy link

24K commented Jun 26, 2011

Hello guys, I'm sorry if I'm hijacking this thread, but I'm at the verge of pulling my hair out and I think my issue is related to OP's issue.
Been struggling for 2 days with this plugin now to resolve an issue. It sounds related to the aforementioned by the OP.
My infinite scroll seems to work fine. (as in, it scrolls infinite). However, I have set my reading settings to show max. 5 posts on the homepage. So after 5 posts, it will load new posts. BUT, I'm using Cufon for font-replacement and as soon as it loads the next set of posts, my font doesn't change anymore. It seems that I lose every added functionality after it has load the second set (or page) of posts. Is this related to the aforementioned issue by the OP? Any help would be much appreciated.

@adriantomic
Copy link
Author

I don't think we have the same problem. My problem was that infinite scroll misinterpreted my url (1-2-3.dyndns.org) as a page number.

I think you need to set some kind of javascript in the callback function of Infinte-scroll. So it will reset the cufon font replacement for the next page that loads.

If you can't get that to work you might want to try to import the font using CSS @font-face.

@lukeshumard
Copy link
Contributor

@adriantomic speaks the truth. Try cufon.refresh() in your callback.

@24K
Copy link

24K commented Jun 26, 2011

Hey guys, thanks for the replies and sorry for posting my issue in yours. We indeed have a different problem.
Unfortunately I'm not sure where to put "cufon.refresh()" .

The below is a callback, right? :

Cufon.replace('content');

Should I then use cufon.refresh() instead of the Cufon.replace?
Sorry if I may sound stupid. But this is my first time I'm working with infinite scroll and cufon together.

Thanks again for the quick reply guys.

@lukeshumard
Copy link
Contributor

$('#your-selector').infinitescroll({
    /// your options
}, function(newElements) {
    // this is where you specify your callback function
    // 'newElements' refers to all of the new content the plugin loaded
    Cufon.refresh();
});

You can also try Cufon.refresh(newElements) but I've never used Cufon's refresh method with a selector for an argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants