Tag Archive
2.7 8.10 9.04 9.10 100th acquisition advertising amd aol apache apple assp ati beta black hole blog browser bug building business caching callback CAN-SPAM can spam act centos chrome clamwin code collider comments compression computer css datacenter delayed development digg documentation earth Edward W. Felten email encryption encyclopedia of life enery eu exploit family fatherhood fedora firefox first plugin folding@home free freeware game Gaming gaming_rig gimp google guides hardware header history home house HPN-SSH HTC icann IE image improvement Infoworld intel Internet ipv6 IT jail kubuntu ldap Leap Day lhc Linux locked files mac mail_server malware me memory microsoft misc money mouse moved Mozilla msdn mysql network solutions nvidia oem open-source os paint_shop_pro patch pc pentium phising phone php plugin post post-revision protocol ram RC record release review rollover safari samba scammers science SCP screenshots script script kiddies security SEO Series server service pack society software son Sony SP3 spam species squirellmail SSH storage stupidity styling sun svn tape tech Techozoic theme threaded tip tips ubuntu Unix update utility video card virtualization vista vlite vmware vsphere web weird WHS windows windows 7 wordpress work worm wsus XP xray
WordPress Theme Developers Tip – Automatic Feed Links in 3.0
Version 3.0 of WordPress is due out soon, and theme developers are getting geared up to implement the new features. The new menu system has received much attention as it’s one of the biggest changes, besides the merge of the WPMU code, that most users will use.
One feature that I didn’t know exists until now is automatic feed links which will output all the different feed links to current page the users is on to the header. It was added in 2.8 but has been changed how it works for 3.0. For example on a single post page the main blog feed, and the single post comment feed links are added to the header allowing a user to easily subscribe to the either feed. Another is on a category archive page the feed for the main blog, as well as the feed for all posts in that category are added. So I’ve got this feature added to my Techozoic theme but to maintain backwards compatibility I though I would share the simple function I came up with.
Read the rest of this entry »
Techozoic Fluid now on Google Code
I’ve just setup proper project management for my Techozoic Fluid theme using Google Code. I have also designed a logo for my theme. If you would like to always have the latest version of Techozoic you may now use Subversion to checkout a copy. If you are like me and keep up with the latest WordPress nightly releases then you’ll know how to checkout code using svn. I use Linux but I’m sure svn works the same for Windows as well.
View the Techozoic Fluid project page.
Svn Checkout Instructions
#cd /path/to/your/blog/wp-content/themes/
#svn checkout http://techozoic-fluid.googlecode.com/svn/trunk/ techozoic-fluid
WordPress Theme Developers Tip – Adding Theme Menu
I’ve already discussed how to add an theme options page. Sometimes, as my theme has, a theme just outgrows having one menu page for everything. Instead of adding a second page under the Appearance Menu a separate menu might be best. The below code is an example of the functions required to use a separate menu.
Read the rest of this entry »
WordPress Theme Developers Tip – Call Dynamic CSS the Right Way
While developing my Techozoic theme, I’ve progressed from adding custom CSS into the head section, to having an external file and using $_GET variables to pull options from the database, to now I believe is the right way to do it, using add_filter and a custom query in WordPress. By using this new method I’ve done away with unsafe $_GET variables and can now use any builtin WP functions in the external file.
First you’ll need to edit your functions.php file and add this block of code.
add_filter('query_vars', 'add_new_var_to_wp');
function add_new_var_to_wp($public_query_vars) {
$public_query_vars[] = 'my_theme_custom_var';
//my_theme_custom_var is the name of the custom query variable that is created and how you reference it in the call to the file
return $public_query_vars;
}
This sets up WP to now accept a new variable in a query called my_theme_custom_var the format of the query would be http://www.yourblog.com/index.php?my_theme_custom_var=css . The ? mark tells WP that this is a query and the = sign tells what the query variable should be set to.
Now to actually setup the function that will call the external file. I found this gem when looking at how popular WP theme called Atahualpa handled it’s external CSS.
add_action('template_redirect', 'my_theme_css_display');
function my_theme_css_display(){
$css = get_query_var('my_theme_custom_var');
if ($css == 'css'){
include_once (TEMPLATEPATH . '/style.php');
exit; //This stops WP from loading any further
}
}
This code now will check if a query is passed to WP with the value my_theme_custom_var and if it is and has the value of css then it includes the style.php file which is our dynamic CSS file. Then the code exits which stops any other functions from happening other wise the whole home page is outputted along with the style.php file, which isn’t what is needed only the file.
Now you can use any WP functions on the style.php file as it is included from the functions.php file which is a standard WP file.
Source : Will Norris
WordPress Theme Options Framework Ver 2
As I’ve worked more on my theme and increased my coding skills I’ve added to my original theme option framework. I’ve become more aware of best practices of coding and WordPress, a big issue with the original framework was the way options were added to the wp_options database table. Each theme option got it’s own entry in the table, this might be okay for small theme, but I’ve grown to over 40 different options in my Techozoic theme. It was time to optimize, with the new framework the entries added to the wp_options table went from 40 to 2. I’ll continue below with code examples and explanations. As an added bonus I’ve included an example of how to pull your theme options into a external stylesheet, based off of this concept.
