Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
The right way removing widgets on certain pages using functions.php? « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

The right way removing widgets on certain pages using functions.php?

(6 posts)
  • Started 4 years ago by antesark
  • Latest reply from Lenwood
  • This topic is not resolved
  1. antesark
    Member

    Topic says it all.

    My question is, how do I remove/add certain widgets on certain pages (single, mainpage, page and so on)..? All the widgets I need to remove/add are coded by hand in the same functions.php..

    Posted 4 years ago #
  2. antesark
    Member

    Added if-function to the widget code tex:

    function childtheme_sidebar_search() {
    if ( is_home() ) {
    code here..
    }
    }

    This seemed to do the trick clean..

    Posted 4 years ago #
  3. antesark
    Member

    Ok, I guess I need to check if widget is active.. otherwise site halts.

    Posted 4 years ago #
  4. antesark
    Member

    Im trolling my own post.. anyways, got it to work (prolly theres some more fancy way of doing this and feel free to post here if you know how)..

    function childtheme_sidebar_related() {
    if ( is_active_widget('childtheme_sidebar_related') && is_single() ) { ?>
    <div id="sidebar_related_posts">
    </div><!-- sidebar_related_posts -->
    <?php }
    }

    Posted 4 years ago #
  5. Danieliser
    Member

    here is what i came up with. i also have several other functions and invite you to add yours @ Wiki-4-Thematic

    function remove_widget_areas($content) {
        if ( is_home() ) {
    	unset($content['1st Subsidiary Aside']);
    	unset($content['2nd Subsidiary Aside']);
    	unset($content['3rd Subsidiary Aside']);
    	unset($content['Index Top']);
        }
        return $content;
    }
    add_filter('thematic_widgetized_areas', 'remove_widget_areas');
    Posted 4 years ago #

  6. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Lenwood

    Member

    Thanks Danieliser! I'd been trying to code this up myself when I came across this. Brilliant!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183