Widget Titles Don't Update
  • reddykilowattreddykilowatt November 2010

    Titles for WP Answers widgets will not update after I click Save. Is this a bug?

  • olioli November 2010

    Hi,
    If you open functions.php in the theme directory, you can edit them there,
    They were hard-coded as we use some custom styles for them.

    WP-Answers Admin | Contact Me if you need help.

  • reddykilowattreddykilowatt November 2010

    Awesome, thanks oli! I've created a child theme, so that's an easy change.

  • reddykilowattreddykilowatt November 2010

    OK, "easy" was a little premature ;) I'm trying to override the function but am running into an error. Here's my code in my child theme's functions.php file:

    ====
    [code]
    add_action('after_setup_theme', 'child_theme_widget');

    function child_theme_widget($args, $instance) {
    extract( $args );
    $title = apply_filters('widget_title', $instance['title']);
    ?>
    <?php echo $before_widget; ?>

    MY NEW WIDGET TITLE



      <?php wp_list_cats( 'hide_empty=0' ); ?>


    <?php echo $after_widget; ?>
    <?php<br /> }

    function remove_widget() {
    remove_filter('widget_title','widget');
    }
    add_action('after_setup_theme','remove_widget');
    [/code]

    BBCode?
    ====

    This prints out this error:

    Warning: Missing argument 2 for child_theme_widget() in .../mychildtheme/functions.php on line 6

    Warning: extract() [function.extract]: First argument should be an array in .../mychildtheme/functions.php on line 7

    It also prints out MY NEW WIDGET TITLE and the list of categories, but at the top of the page underneath the error message. The default widget title and widget are also shown on the page, in the correct location.

    My function is almost working, but the overriding is not. Can you offer some advice? I'd prefer not to hack the WP-Answer theme's functions.php file unless I must. TIA!

  • reddykilowattreddykilowatt November 2010

    Along the same lines, I can't seem to override some parts of the WP-Answers theme in my child theme. For example, I copied login-form.php to my child theme directory and removed the H2 heading at the top. No change. Making the same edit to the default file worked. Another example is the hard coded styles for the Register button in registerform.php... I couldn't override those in my child theme, nor could I override the button value (which I want to change to "Sign Up".) I had to edit the default file to make these changes. Meanwhile, I've overridden code in footer.php without problems. What am I missing? Thanks!

  • olioli November 2010

    I havent worked with child themes before,
    Ill have a look into it for you.

    WP-Answers Admin | Contact Me if you need help.

  • reddykilowattreddykilowatt January 2011

    Child theme and function override functionality would be super sweet! As it stands, I have a child theme that only works half the time, and for other edits I have to modify the WP-Answers theme or plugin files directly, which will break on the next WP-Answers upgrade and force me to manually copy the upgrades into my modified files.

  • xactwebxactweb March 2011

    I agree this is something I would like fixed as well. The search widget is nice but I dont' need the title for it.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Tagged

  • 59