Tag archive for "wordpress"

Order posts in a $wp_query manually

Build a custom WordPress query and order the posts however you want them. Notice that this won't work properly if you page results, so it is only useful in very specific cases. Btw, wrap everything into your class and get rid o the global var when you use this ;-) more

How to minify WordPress theme stylesheets properly

If you build WordPress theme you'll eventually come to the point where you want to minify the stylesheets. But the WordPress theming system has a fundamental flaw: It expects theme headers like name, version information etc. to be in the style.css. This is bad because removing the headers from the ... more

Dynamic search form for a WordPress 404 page

Show the user a useful search form when on a 404 page. Turn the query string into a search. more

A Better Related Posts Plugin

There are many plugins that find related posts for WordPress, and I was happy to use one of them in the past. However, WordPress evolves. One of the biggest change was the addition of custom post types. They are very useful and I use them a lot for my own ... more

Better Recent Posts Widget

The built-in recent posts widget in WordPress isn't too bad, but it doesn't support custom post types. That's why I wrote this new widget. You can choose any custom post types you want. This way you can always get a list of recent updates on your blog. The widget ignores ... more

WordPress Pastebin

This plugin is for you if you like sharing your code. Turn your blog into a pastebin and keep your own code on your own site. You can tag your pastes like you tag your normal posts, and visitors can leave comments if you allow it. I wrote this because ... more

WordPress rewrite rule for custom taxonomies

This makes it possible to have the taxonomy below some post type slug, e.g. the post type is at /cars/ and taxonomies are at /cars/manufacturer/, /cars/year-of-construction/ etc. You want to register the taxonomy with the same $slug. more

Add custom post types to the WordPress query

Run the filter whenever you want your post type in the main loop. Add is_home(), is_category() etc. Example is for the post type 'paste'. more

Get a category name/slug/id for a post or archive page

There's obviously a little context missing for this paste, but the basic idea should be clear ;-) more

Simple upload field for WordPress plugins/themes

With this you can upload images through your plugin/theme. They are saved as attachments. Please add nonce fields for security reasons. more