ThemeShaper Forums » Thematic

[closed]

overiding a default widget

(2 posts)
  • Started 8 years ago by lambeboy
  • Latest reply from Chris
  • This topic is not resolved
  1. lambeboy
    Member

    i am trying to override the "recent_post" widget and i am studying the widgets-extentions.php,widgets.php to figure out how thematic overrides search,meta, rss. I this in my function.php:

    // line 51 from widgets.php
    function widget_mychildtheme_recent_posts($args) {
    extract($args);
    if ( empty($title) )
    $title = __('Recent-posts', 'mychildtheme');
    ?>
    this is a test
    <?php
    }

    //from line 280 in widget-extentions.php
    register_sidebar_widget(__('Recent-posts', 'mychildtheme'), 'widget_mychildtheme_recent_posts', null, 'recent-posts');
    unregister_widget_control('recent-posts');

    This seems to work but it breaks my other widgets and they dont show. (Pls note, i am a noob, if some of this code looks out of place)

    Posted 8 years ago #
  2. Hi,

    please do not use the old widget code. I already changed all Thematic widgets to the new style. Grab a copy from the SVN or take a look at these links:

    http://wpengineer.com/wordpress-built-a-widget/
    http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28

    Chris

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.