Infinite Scroll is a popular way to dynamically load fresh content into a site as a user scrolls down through it. It’s also quite easy to code into a WordPress theme. Here’s a quick walkthrough of how to do it:
Continue reading
Infinite Scroll in WordPress
Infinite scroll has become a standard feature in many web applications. Twitter and Facebook are the ones I use every day, but it’s also in a ton of Tumblr themes and Cargo Collective sites.
I feel WordPress themes has been slow to adopt infinite scroll- but after adding it to my site over the weekend I understand some of the complications.
Unlike Tumblr or Cargo Collective, WordPress (.org) users can use plugins to add all sorts of javascript to posts. On my site Syntax Highlighting is the main culprit (which I use to display code snippets), but many others have social buttons or lightboxed images.
When infinite scroll pulls in additional posts via ajax, it doesn’t load the javascript code from the header or footer of the post that might be needed to display js content (e.g. social buttons, formatted code, etc) properly. That puts theme authors in a bind. Infinite scroll may be a better end user experience, but it’s going to lead to more support requests during theme set up.
However, if you don’t use much javascript in your post content, or if you display excerpts on your index pages rather than full posts, I’d suggest trying it out.
The Infinite Scroll plugin recently had a complete rewrite, and I can now recommend using it again. If you use the plugin you should be able to set up infinite scroll for your theme in just a couple minutes.
I’ll also posted a tutorial about how to add Infinite Scroll to a theme without a plugin.
Useful Links:
- Infinite Scrolling Best Practices (UX)
- Should You Use Infinite Scroll Instead of Pagination?
- https://github.com/paulirish/infinite-scroll
Image Credit: Infinity Pool
WP Engine Hosting Review
I’ve hosted most of my sites with BlueHost for over six years, but I recently migrated this one over to WP Engine. Mainly I was curious to see what the impact on page speed would be. As WP Theming has grown in traffic so have the load times– despite good caching, gzipped files, minified scripts and css, and sprited images.
Color Palettes with the Options Framework
An example of how to extend the Options Framework to enable color palettes to be selected by users.
Custom Design on WordPress.com
If you want a highly customized theme for your WordPress site the only option is to self-host, right? Not so fast…
Event Posts in WordPress
A tutorial explaining how to create an events post type, complete with custom meta boxes and an example query. There’s also an example plugin that can be downloaded from GitHub.
Cleaning Up the TimThumb Hack
Several of my websites were hacked this last week using the TimThumb exploit. Here’s instructions on how to find the files and replace them- and also the process I used for patching up my sites after the hack.
Portfolio Post Type Plugin
I recently released a plugin to WordPress.org that registers a portfolio post type, related taxonomies, and adds an image when you’re viewing the items in the dashboard. Here’s a walk through of the code involved.