Page Navigation For WordPress Twenty Eleven

By default, most WordPress themes (including Twenty Eleven) have relatively weak page-to-page navigation.  Users can improve content structure on their WordPress blogs by using categories, tags, and custom menus, but one navigation element that’s a bit more difficult to modify are the “Next Page/Previous Page” links.  These links are great if you want to move a page at a time, but if your blog has lots of pages, users won’t easily be able to navigate very deeply into your content.  That’s where a page navigation menu comes in handy.

Here’s how to implement page navigation, using a plugin and a simple modification to the WordPress Twenty Eleven theme.

Using a plugin?  For shame!

Usually, I’m not a big fan of using plugins for every little modification on my blogs. While there are some amazing WordPress developers out there, there are many less than perfect ones as well, and by loading up your blog with their buggy code can really slow (or brick!) your blog.  However, for something as complex as page navigation, I’ve opted to use the WP-PageNavi plugin.  With over a million downloads, I’m fairly confident that this plugin’s popularity indicates its code quality.  Since I’ve installed it, I’ve seen no performance deterioration…

So the first step for this tutorial is to install this plugin!

Modifying your Twenty Eleven child theme for Page Navigation

When you install this plugin and refresh your blog, the first thing you’ll realize is that nothing happened!  This occurs because the plugin itself doesn’t know where you want to put the page navigation; this needs to be done with some minor PHP coding.

In your WordPress Twenty Eleven child theme, we need to add a new PHP file if it’s not already available:  index.php.  It is this file that controls the front page container of the blog, and is where the “Next Page/Previous Page” code resides.

In the index.php file, find the following code:

<?php twentyeleven_content_nav( 'nav-below' ); ?>

We want to comment this code out by doing the following:

<?php /*twentyeleven_content_nav( 'nav-below' );*/ ?>

Finally, we want to add a call to the page navigation function by placing the following code directly under the code we just commented out:

<?php wp_pagenavi(); ?>

Once you hit save and refresh your blog, you should now see the page navigation at the bottom of your blog where the default navigation option used to reside!

WP-PageNavi Settings

The default settings for this plugin should be sufficient for most users, but if you want to change how many page numbers show in the navigation, or any of the other options, you can go to the Settings menu and click on “PageNavi”.  The only setting I’ve changed so far is the “Number of Pages to Show”, which I set to 10 because I like round numbers.  Given that this blog only has 8 pages as of the time of the tutorial, this means all pages are showing in the page navigation.

Customizing the Page Navigation with CSS

The plugin by default has its own CSS turned on, which makes the menu look pretty stylish on its own.  Because the page navigation are links, the plugin will keep the same styling as the rest of your page.  Pretty cool!

The only CSS modification I made was to put a small amount of padding on the bottom of the navigation, because it was sitting on top of the gray horizontal line for the footer.  To correct this problem, place the following code in your style.css file:

div.wp-pagenavi { padding-bottom: 10px;}

You can change the number from “10” to any amount of pixels you’d like, as your design eye sees fit.

And that’s it!  Any questions? Leave a comment 🙂


Google Analytics Individual Qualification (IQ) - Passed!


iPhone 4S: A Worthy Upgrade Clouded By Activation Issues

When the iPhone 4S was announced on October 4th, there was much gnashing of teeth by Apple fanboys and stock market analysts about how this “lackluster” iPhone refresh was going to allow competitors to overtake Apple. That without a re-designed case and bigger screen and more storage and…and…and. All of the rumors (and the subsequent disappointment) ignored one of the simple economic realities of the cell phone market:

When buyers are locked in a two-year upgrade cycle, you don't need to change the product landscape with every model.

So if you’re like me and using an iPhone 3GS (or older!), the iPhone 4S should definitely be a worthy upgrade.

iPhone 4S Hardware: Many Improvements over the iPhone 3GS

One of the biggest reasons I’ve been looking to upgrade from the iPhone 3GS is that my phone has just started acting “tired” in the last 6-9 months.  When I purchased the 3GS, that was before iOS4 and iOS5, and with each iOS update I’m sure the processor usage has increased.  Skipping the iPhone 4 and waiting for the 4S, that’s two processor upgrades compared to my current phone, which I’m sure will make the phone feel that much speedier.

But it’s not just the processor here that’s a huge improvement…moving to the 4S gives a better camera with flash, front-facing camera to use with FaceTime, the Retina display for improved screen clarity, longer battery life, and 1080P video capturing.  I opted to purchase the white iPhone 4S (which doesn’t provide any additional functionality!) and upgraded to the 32GB storage instead of 16GB on my 3GS.

I think it’s safe to say that even without a case re-design, the iPhone 4S is in a different world hardware-wise than my current 3GS.

iPhone 4S Activation Issues

At this point, you’re probably expecting that I would cover how the iOS5 software is working on said hardware upgrade.  But if you’ve been following any of the major tech blogs like CNET, you see that there are widespread reports of users being unable to activate their iPhone 4S’s.  At first, I thought it was just AT&T’s generally poor service and network, but InformationWeek is reporting that all carriers are experiencing this phenomenon.  There may have been gnashing of teeth during the iPhone 4S announcement, but with Apple’s announcement of a pre-sale sell out, clearly there are ton of buyers out there.

One thing I can blame on AT&T though is a lack of foresight of proper error messaging.  When you sign in through iTunes, here’s the error message you get:

iphone-4S-activation-error-att

Well, which is it AT&T and Apple?  If my activation is still pending, and you are going to send me an email, why do I need to try again later?  I have to believe that some of the activation server problems stem from not being clear about what to do.  With users (like myself) re-sending the activation over-and-over again, and potentially a script inside of AT&T trying to activate all these iPhones, there’s got to be a ton of redundant processor cycles being burned.

I’ve also tried to activate straight from my iPhone via Wi-Fi and over the 3G cell network, and even called AT&T.  Not surprisingly, the customer “service” rep at AT&T claimed there’s no internal report of an activation problem, but I should try iTunes to see if that will activate my phone.

Thanks for nothing.

Once the Activation Issues disappear…

Eventually, I’ll be really happy with my purchase.  Until then, I’ve got the equivalent of a Christmas present that comes “Some Assembly Required” or “Needs Batteries (not included)”.  What was the promising start to the weekend with my new iPhone 4S is now just a blackout period, waiting for AT&T to get their shit together.

Update:  New error message

As if the first confusing error message wasn’t enough, now AT&T/Apple have switched it to say “Turn your phone on and off to retry”.  Wow, the old “Did you reboot your PC?” trick!

7 hours in, who knows how many attempts…no activation.

iphone-4s-activate-off-on

Update 2:  iPhone 4S Activation Complete!

After 7 hours of trying, finally I have a working iPhone 4S!

iphone-4S-activation-complete


  • RSiteCatalyst Version 1.4.12 (and 1.4.11) Release Notes
  • Self-Service Adobe Analytics Data Feeds!
  • RSiteCatalyst Version 1.4.10 Release Notes
  • WordPress to Jekyll: A 30x Speedup
  • Bulk Downloading Adobe Analytics Data
  • Adobe Analytics Clickstream Data Feed: Calculations and Outlier Analysis
  • Adobe: Give Credit. You DID NOT Write RSiteCatalyst.
  • RSiteCatalyst Version 1.4.8 Release Notes
  • Adobe Analytics Clickstream Data Feed: Loading To Relational Database
  • Calling RSiteCatalyst From Python
  • RSiteCatalyst Version 1.4.7 (and 1.4.6.) Release Notes
  • RSiteCatalyst Version 1.4.5 Release Notes
  • Getting Started: Adobe Analytics Clickstream Data Feed
  • RSiteCatalyst Version 1.4.4 Release Notes
  • RSiteCatalyst Version 1.4.3 Release Notes
  • RSiteCatalyst Version 1.4.2 Release Notes
  • Destroy Your Data Using Excel With This One Weird Trick!
  • RSiteCatalyst Version 1.4.1 Release Notes
  • Visualizing Website Pathing With Sankey Charts
  • Visualizing Website Structure With Network Graphs
  • RSiteCatalyst Version 1.4 Release Notes
  • Maybe I Don't Really Know R After All
  • Building JSON in R: Three Methods
  • Real-time Reporting with the Adobe Analytics API
  • RSiteCatalyst Version 1.3 Release Notes
  • Adobe Analytics Implementation Documentation in 60 Seconds
  • RSiteCatalyst Version 1.2 Release Notes
  • Clustering Search Keywords Using K-Means Clustering
  • RSiteCatalyst Version 1.1 Release Notes
  • Anomaly Detection Using The Adobe Analytics API
  • (not provided): Using R and the Google Analytics API
  • My Top 20 Least Useful Omniture Reports
  • For Maximum User Understanding, Customize the SiteCatalyst Menu
  • Effect Of Modified Bounce Rate In Google Analytics
  • Adobe Discover 3: First Impressions
  • Using Omniture SiteCatalyst Target Report To Calculate YOY growth
  • Google Analytics Individual Qualification (IQ) - Passed!
  • Google Analytics SEO reports: Not Ready For Primetime?
  • An Afternoon With Edward Tufte
  • Google Analytics Custom Variables: A Page-Level Example
  • Xchange 2011: Think Tank and Harbor Cruise
  • Google Analytics for WordPress: Two Methods
  • WordPress Stats or Google Analytics? Yes!
  • Building a Data Science Workstation (2017)
  • JuliaCon 2015: Everyday Analytics and Visualization (video)
  • Vega.jl, Rebooted
  • Sessionizing Log Data Using data.table [Follow-up #2]
  • Sessionizing Log Data Using dplyr [Follow-up]
  • Sessionizing Log Data Using SQL
  • Review: Data Science at the Command Line
  • Introducing Twitter.jl
  • Code Refactoring Using Metaprogramming
  • Evaluating BreakoutDetection
  • Creating A Stacked Bar Chart in Seaborn
  • Visualizing Analytics Languages With VennEuler.jl
  • String Interpolation for Fun and Profit
  • Using Julia As A "Glue" Language
  • Five Hard-Won Lessons Using Hive
  • Using SQL Workbench with Apache Hive
  • Getting Started With Hadoop, Final: Analysis Using Hive & Pig
  • Quickly Create Dummy Variables in a Data Frame
  • Using Amazon EC2 with IPython Notebook
  • Adding Line Numbers in IPython/Jupyter Notebooks
  • Fun With Just-In-Time Compiling: Julia, Python, R and pqR
  • Getting Started Using Hadoop, Part 4: Creating Tables With Hive
  • Tabular Data I/O in Julia
  • Hadoop Streaming with Amazon Elastic MapReduce, Python and mrjob
  • A Beginner's Look at Julia
  • Getting Started Using Hadoop, Part 3: Loading Data
  • Innovation Will Never Be At The Push Of A Button
  • Getting Started Using Hadoop, Part 2: Building a Cluster
  • Getting Started Using Hadoop, Part 1: Intro
  • Instructions for Installing & Using R on Amazon EC2
  • Video: SQL Queries in R using sqldf
  • Video: Overlay Histogram in R (Normal, Density, Another Series)
  • Video: R, RStudio, Rcmdr & rattle
  • Getting Started Using R, Part 2: Rcmdr
  • Getting Started Using R, Part 1: RStudio
  • Learning R Has Really Made Me Appreciate SAS