[HOWTO] WordPress Child Themes

Here is an easy was to keep your custom edits to the theme php files.

We need to create a child theme that uses the garland core files for the main theme functions as well as and custom code you add, then when you update the theme from within wordpress only the parent theme will get changed, your child theme will remain intact!

first off we create a new folder within the themes dir and give it a name, inside it we put a style.css file. Ive chosen garland-redux for this example as were protecting my garland theme from changes…we still need the original garland-revisited theme folder, so dont go deleting it!

so your directory path will look like this:

wp-content
|_themes
        |_garland-revisited
        |_garland-redux
                       |_style.css

The format for the style.css file is simple, it just tells the child theme where the parent is:

/*
Theme Name: Garland-redux
Theme URI: http://www.pross.org.uk
Description: Testing WordPress Child Themes
Author: Simon Prosser
Author URI:http://www.pross.org.uk
Template: garland-revisited
Version: 1.0
.
This work, like WordPress, is released under GNU General Public License, version 2 (GPL).
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
.
*/

@import url('../garland-revisited/style.css');
[HOWTO] WordPress Child Themes

[HOWTO] Display number of spams stopped since your blog started.

So i wanted to display total number of spam coments blocked by askismet. Checking the the plugins source i found this function which returns the number:
[php]get_option(‘akismet_spam_count’);[/php]
Getting the blogs first post date was the tricky bit and required a database query:
[php]$firstpost = $wpdb->get_var("SELECT post_date FROM $wpdb->posts WHERE post_type = ‘post’ AND post_status = ‘publish’ AND ID >0 LIMIT 1");[/php]
The query checks the first post above zero as most people delete post #1.

So the complete code is:
[php]<?php echo get_option(‘akismet_spam_count’); ?> Spams caught since
< ?php
$firstpost = $wpdb->get_var("SELECT post_date FROM $wpdb->posts WHERE post_type = ‘post’ AND post_status = ‘publish’ AND ID >0 LIMIT 1");
echo gmdate(‘M Y’,strtotime($firstpost));
?>[/php]
the result looks like this:
10253 Spams caught since Jun 2006

[HOWTO] Display number of spams stopped since your blog started.

Garland 1.2

Ive updated Garland-Revisited.

I had some problems with farbtastic and jquery with wordpress 2.8, after much hair pulling ive ditched farbtastic and the theme uses jscolor.

Please someone try it with 2.8 and let me know if there are any problems, ive tried 2.8 and 2.8.1b2.

here is the link to 1.2 of the theme: HERE

Garland 1.2

Garland-revisited WordPress Theme

Garland-revisited

A flexible, three-column theme with customizable colors.

Design based on Themetastic for Drupal by Stefan Nagtegaal and Steven Wittens.

I took this theme and gave it new life by making it 2.7 compatible, the color changer in the admin section is also fixed.

Latest version is always here at the theme database http://wordpress.org/extend/themes/garland-revisited

Test blog for the theme is here

1.9 current release

1.6 css fix

1.5 Sidebar disable options added to admin page, many fixes!

1.1 Fixes bugs.

1.0.0 Updated for wordpress 2.8. Cleaned up css. Added rss and ping links.

0.9.6 More bugs fixed, almost final version now! Admin link in header added, only shows if admin is logged in. Blockquote css added to options with nice transparent .png.

0.9.5 Fixed bugs

0.9.4 Option for fixed/full width in admin, footer was not showing in IE, new css.php used for custom colors so page still validates always, blog tag smaller and italic.

0.9.3 Bug found in functions.php stopping the theme preview from redrawing.

0.9.2 HTML fix in comments.php, now validates fully. Search.php added with custom output and highlighted searchterms.

0.9.0 First release.

wp-super-cache users please add the following to your rejected URI’s:- garland_css=1 super-cache plugin adds a comment to the cached css which firefox does not like!

Garland-revisited WordPress Theme

The manual Excerpt in WordPress

Using this post i finally understand what exerpts are for and how to use them, you can read the original here: http://op111.net/67

The manual Excerpt in WordPress. What, why, how, tips and plugins

WordPress excerpts, which are not excerpts, make a WordPress site easier to browse and its content easier to discover. In addition, when also used as META descriptions, good excerpts bring more and better traffic from search engines.

This article looks into the WordPress Excerpt and explains how to use it.
Continue reading “The manual Excerpt in WordPress”

The manual Excerpt in WordPress