Tag archive for "theme"

Import WXR files from server or on plugin activation

I recently patched the WordPress reset plugin to make it possible to reactivate multiple plugins after the reset. Until sivel releases an update you can download the patched version from my server. As I frequently need to wipe WordPress installs during development I was looking for a way to auto-load ... more

Set static front page and blog page programmatically in WordPress

You want to make sure the About and Blog pages exist, so create them before if necessary, see wp_insert_post() 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

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

Preserve options when using multiple pages and the settings api

See my previous paste for the whole class (minus this) http://kuttler.eu/code/wordpress-plugintheme-options-page/ more

WordPress plugin/theme options page

I use helper methods/functions in my themes and plugins to create the input fields, this was simplified for the example here. more

WordPress pagination