Take note: DM-Bloodless support has been discontinued by the author long ago. For great WordPress themes try Themeforest [partner-link]. Check out PIM, Deadline or TutsPlaza [partner-links] instead.
I fixed DM-Bloodless! Well, kudos to Deaf Musician for this lovely black and white WordPress theme. As it’s his first one he overloooked something. It caused an ugly error that was difficult to locate without prior knowledge of WordPress or PHP.
The dreaded “Warning: Cannot modify header information – headers already sent” error was produced by the functions.php
As stated in the WordPress Forum here every page of the internal WordPress code has to start with a “<?php” without prior spaces or blank lines. Also, no white space is allowed after the closing tag “?>”.
Moreover you have to use one PHP block for all PHP code, unlike now where every function has it’s own block with, of course, white space in it.
You can substitute your old one in the dmbloodless folder. Coded correctly, it looks like that:
<?php
/*
Template Name: Functions
*/
include(dirname(__FILE__).’/themetoolkit.php’);
themetoolkit(
‘dmbloodless’,
array(
‘about’ => ‘About This Blog {textarea|3|50} ## Keep it so it fits on one line.’,
‘style’ => ‘Theme Color Option {radio|bw|Black On White|wb|White On Black}’,
),
__FILE__
);
function dmbloodless_about() {
global $dmbloodless;
print $dmbloodless->option['about'];
}
function dmbloodless_style() {
global $dmbloodless;
$dmb_style = $dmbloodless->option['style'];
return $dmb_style;
}
if ( function_exists(‘register_sidebar’) ) {
register_sidebar(array(‘name’=>’Sidebar 1′,
‘before_widget’ => ‘<div id=”%1$s” class=”data %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<div class=”titles”>’,
‘after_title’ => ‘</div>’,
));
register_sidebar(array(‘name’=>’Sidebar 2′,
‘before_widget’ => ‘<div id=”%1$s” class=”data %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<div class=”titles”>’,
‘after_title’ => ‘</div>’,
));
}
/* default values upon theme install */
if (!$dmbloodless->is_installed()) {
$set_defaults['about'] = ‘Write something about your blog, see theme options for more.’;
$set_defaults['style'] = ‘bw’;
$result = $dmbloodless->store_options($set_defaults);
}
?>
Last updated: October 7th, 2010.
Related posts:
- DM-Bloodless IE 6 Sidebar Incompatibility Problem Discovered and Solved
- Saturday Night Fever for WordPress Theme Customization: How to Simplify
- How to Remove utm_source & Other Parameters From Your URLs
- Quit SEO, Use WordPress
- Blog Rock & Roll
Need help? Consider a world class blog & SEO consultation by the author of SEO 2.0, Tad Chef. For full fledged SEO services like ongoing link building, contact my partners from SEO.com or look up my directory of SEO service providers and checkout reputable companies like Datadial or Redfly.
Already an SEO? Consider applying to be added to my exclusive SEO agency directory. Only selected companies get included. Find out whether you are eligible to submit your site.
This thing has 5 Comments
Sweeeeeet! Thanks a lot, man!
Well thank you for making this blog possible. Before, I was convinced that I have to create a theme of my own to suite my needs…
Hi there,
Thank you so much for this fix — if I can get it working, dmbloodless would work beautifully for my blog.
Unfortunately, I bollixed up the repair somehow so if you tell me what I did wrong or otherwise, send me the proper functions.php as an email attachment, I would love that. (I also posted this query to deadmusician a few days back but haven’t received an answer).
Here’s what I did:
1. cut & paste fix shown above into a blanked out version of the original functions.php, hit save.
2. Get error message there are characters that cannot be saved in Ansi, so I choose Unicode, which crashes my website.
4. Try again, saving it in Ansi, receive error message stating: Parse error: syntax error, unexpected T_STRING, expecting ‘)’ in /home/myusername/public_html/myblog/wp-content/themes/dmbloodless/functions.php on line 17
So yes, I’m a lamer at a total loss, but do please forgive me a little, as I am in my forties, i.e., dodderingly ancient in blogger terms.
Many thanks for your help!
oh, and if anybody else wants to write to me about this, I can be reached at:
amysemail
AT
gmail
DOT
com
Thanks again.
Thank you so much for this, the easy cut and paste instructions are a life saver!
This thing has 4 Trackbacks
[...] The nice folks at SEO Refugee, my favorite SEO Forum in this universe reviewed my new SEO 2.0 blog. As I value their opinion very much I reacted quickly. One problem mentioned where empty categories leading to a funny but cryptical 404 message devised be the Deaf Musician for the DM Bloodless theme. [...]
[...] Musician, author of the great minimalistic WordPress theme DM Bloodless that I use offers to create a custom WordPress Theme for a passionate blogger for free! I wonder [...]
[...] care of the SEO of your site, use a black and white theme. Do not stuff your pages with thousands of widgets and buttons. Leave plenty of white space. Make [...]
<p>[...] a small del.icio.us widget in my footer I noticed that my theme, DM-Bloodless, which I consider the best black/white WordPress theme of all times, has a minor [...]</p>