Category Archives: Programming

WordPress 3.6, Read More Links Broken

My WordPress sites updated to 3.6 pretty smoothly.

Read More links for post excerpts are not being output by functions.php.

The fix is simple. Just change … to … in the filter.

Automatic Related Products for LemonStand

Online stores can be overwhelming to maintain. LemonStand Cart requires that you set related products on each of your products. Clients with large numbers of products prefer automation where possible.

Automatic Related Products for LemonStand

If the client does not specify related products, the below partial code will show related products from the database. The script grabs products from parent categories to ensure that the output remains relevant.

Partial Code

The partial is formatted for a theme based on Foundation 3 responsive framework. You may have to tweak the output to work for your LemonStand site.

WordPress Pagination Breaks when Custom Posts are Included in the Query

I’ve been using All-in-One Event Calender for a recent client project. They would like to show both recent blog posts and ai1ec_event (custom) posts in one blog feed style page.

custom-posts-featured

If I disable pagination (increase the limit) they all display fine, but as soon as I enable pagination I see 404 when I try to access page 3, sometimes I can get page 2 to work. You would think if pagination was not working it would 404 on page 2 every time.

Here is the query I was trying.

After a few days of persistent searching, I found a similar solution for custom post types. It turned out to be a WordPress 3.4 bug.

The below code needs to be added to your functions.php if you are experiencing this bug. What triggered me to believe it isn’t the plugin, was that pagination worked fine in the search result output.

Hopefully this helps a few people.