Ads

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);

}

?>

del.icio.us StumbleUpon Facebook Google Mixx Sphinn TwitThis
July, 2007 | You can follow comments through the RSS 2.0 feed. You can leave a comment, or trackback.

This thing has 4 Comments

  1. Posted July 20, 2007 at 6:48 pm | Permalink

    Sweeeeeet! Thanks a lot, man!

  2. onreact
    Posted July 20, 2007 at 8:52 pm | Permalink

    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…

  3. Posted March 9, 2008 at 11:11 pm | Permalink

    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!

  4. Posted March 9, 2008 at 11:13 pm | Permalink

    oh, and if anybody else wants to write to me about this, I can be reached at:

    amysemail
    AT
    gmail
    DOT
    com

    Thanks again.

This thing has 4 Trackbacks

  1. Posted July 24, 2007 at 4:02 pm | Permalink

    […] 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. […]

  2. Posted July 26, 2007 at 12:14 pm | Permalink

    […] 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 […]

  3. Posted August 6, 2007 at 9:33 pm | Permalink

    […] 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 […]

  4. Posted August 20, 2007 at 6:21 pm | Permalink

    <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>

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*