• Resolved greenie shameface

    (@greenie-shameface)


    Hello, this is my site: http://www.montrealvip.com

    I want to be able to widgetize this theme, but when following wordpress instructions to insert/add code to functions.php., I hit a roadblock, because my functions.php reads:
    <?php remove_action('wp_head', 'wp

    From looking this up I discern that this was put in for a specific purpose, so how do I widgetize my theme without messing up the code that is already there?

    I hope that made sense. Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Please repost that line of code. All the interesting bits got chopped off somehow.

    if (function_exists('register_sidebar')) {
    	register_sidebar (array(
    		'name' => 'homeLowerBox1',
    		'id' => 'homeLowerBox1',
    		'description' =>'Home Lower Box 1',
    		'before_widget' => '<div class="homeContent padding50">',
    		'after_widget'  => '</div>',
    		'before_title'  => '<h2>',
    		'after_title'   => '</h2>'
    	));
    }

    Change it to fit your own site. Like s_ha_dum said, your code got cut off but, if you put it outside the other logics in the functions.php you should be fine.

    Thread Starter greenie shameface

    (@greenie-shameface)

    <?php
    remove_action('wp_head', 'wp_generator');
    ?>

    @greenie shameface, that won’t effect your widgets at all. WordPress prints a meta ‘generator’ tag with its name an version as the value. All that ‘remove_action’ does is remove that generator tag.

    Just do what potentweb said.

    Thread Starter greenie shameface

    (@greenie-shameface)

    I tried putting it in like so: `<?php
    remove_action(‘wp_head’, ‘wp_generator’);
    ?>
    if (function_exists(‘register_sidebar’)) {
    register_sidebar (array(
    ‘name’ => ‘homeLowerBox1’,
    ‘id’ => ‘homeLowerBox1’,
    ‘description’ =>’Home Lower Box 1′,
    ‘before_widget’ => ‘<div class=”homeContent padding50″>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h2>’,
    ‘after_title’ => ‘</h2>’
    ));
    }` but that just messed up the site by putting nasty-looking code at the top of the page…clearly I am a novice here, so when you say “Change it to fit your own site.” I have no idea what to do…

    PHP code needs to be inside PHP tags– after the <?php and before the ?>.

    Thread Starter greenie shameface

    (@greenie-shameface)

    I completely understand if no one responds…I may just have to contact the theme author about this…Pardon my ignorance!

    Thread Starter greenie shameface

    (@greenie-shameface)

    where in the above suggested code do I specify there is two sidebars (is this not necessary?)

    Do the same thing twice, or an many times as you want, changing the ‘name’, ‘id’, and ‘description’.

    http://codex.wordpress.org/Function_Reference/register_sidebar

    You should probably read up on sidebars some more:

    http://justintadlock.com/archives/2010/11/08/sidebars-in-wordpress

    Thread Starter greenie shameface

    (@greenie-shameface)

    thanks for your help

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘how to widgetize theme when function.php says’ is closed to new replies.