New Theme creation

I found Ian Stewart‘s Theme Development tutorial a wonderful one to start from the scratch with a very little knowledge on WordPress. How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial Hope the explanation there could help you a lot to understand which code block’s for what. So you can modify yours as … Read more

How to remove comment link title attribute?

The title attribute is hard-coded in comments_popup_link() unfortunately: echo ‘ title=”‘ . esc_attr( sprintf( __(‘Comment on %s’), $title ) ) . ‘”>’; What you can do is catching the generated HTML in a variable and replacing the attribute with an empty string: ob_start(); comments_popup_link(); print preg_replace( ‘~ title=”[^”]+”~’, ”, ob_get_clean() );

For best DB performance should I serialize all theme options together or by type?

All options with autoload = yes (default) are fetched very early in one query. So the number of options does affect performance only marginally. Split options if you don’t need everything on every page load. With … add_option( ‘option_name’, ‘option_value’, ”, ‘no’ ); … you can set options that aren’t loaded before you actually call … Read more

Should I use include or load_template for including shortcodes, plugins and so on?

load_template() is for cases where you need the following global variables in an included file: $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID If you don’t need those, or if you use global in those files anyway, it isn’t needed. locate_template() and get_template_part() are for cases when you want to allow child … Read more

Customize the previous_post_link output

I would just filter previous_post_link and next_post_link. This way, your template stays clean, and you move the extra logic to the functions.php. Example, not tested: add_filter( ‘previous_post_link’, ‘filter_single_post_pagination’, 10, 4 ); add_filter( ‘next_post_link’, ‘filter_single_post_pagination’, 10, 4 ); function filter_single_post_pagination( $output, $format, $link, $post ) { $title = get_the_title( $post ); $url = get_permalink( $post->ID ); … Read more