ThemeShaper Forums » Thematic

[closed]

Removing 'page-bottom' using a function

(9 posts)
  • Started 4 years ago by napalm
  • Latest reply from hifiDesign
  • This topic is resolved
  1. Hi Guys,
    I'm trying to use a function to remove the page-bottom widgets from a page.
    I know there are other ways of doing this using css or removing the call get_sidebar('page-bottom'). But I guess this is mainly an exercise to get more of an understanding of WP.

    I currently have this function, which is identical to another I have used to remove 'thematic_sidebar'. I just can't seem to target the 'page-bottom' widgets.

    <?php
    function remove_page_bottom() {
    if (is_page()) {
    return FALSE;
    } else {
    return TRUE;
    }
    }
    add_filter('widget_area_page_bottom', 'remove_page_bottom');
    ?>

    I've tried using 'widget_area_page_bottom' and 'thematic_page_bottom' but nothing so far has worked.

    If anyone could advise, it would be greatly appreciated.

    Thanks

    Posted 4 years ago #
  2. Any ideas guys?

    Posted 4 years ago #
  3. Hi,

    this would be:

    function remove_widgetized_area($content) {
    	unset($content['Page Bottom']);
    	return $content;
    }
    add_filter('thematic_widgetized_areas', 'remove_widgetized_area');

    You can find more options here: How to remove widget areas from the backend?

    Chris

    Posted 4 years ago #
  4. Thanks Chris,

    However I was actually talking about removing 'Page Bottom' from the front end. Is this possible ?

    Posted 4 years ago #
  5. what do you mean by 'the front end'? if you use chris' code the Page Bottom widget will no longer appear on your widgets page.

    if you want to specifically control w/ pages the widget appears on you could do something like what i wrote here

    http://forums.themeshaper.com/topic/custome-sidebar-for-pagesphp#post-13416

    or the easiest thing might be to use the Widget Logic plugin to control which widgets appear where.

    Posted 4 years ago #
  6. Thanks. Sorry if my posts have been vague.

    By front-end I mean what the user sees.
    Basically I was thinking of just creating a function that would allow me to only show the widgets that are located in the 'Page Bottom' area , only on the home page.

    So something like
    if (!is_front_page()) {
    remove 'Page Bottom' from the mark up
    }

    Like I said above, I can do this with CSS, but was just wondering how to do it using a function.

    Posted 4 years ago #
  7. So I think what I'm hearing is that you have a static WordPress front-page and that you only want the page-bottom widget to appear on the front-page page.

    Try this :

    function child_page_bottom($content) {
    	$content['Page Bottom']['function'] = 'child_page_bottom_display';
    	return $content;
    }
    
    add_filter('thematic_widgetized_areas', 'child_page_bottom');
    
    function child_page_bottom_display() {
    	if (is_front_page()) {
    		if (is_sidebar_active('page-bottom')) {
    			echo thematic_before_widget_area('page-bottom');
    			dynamic_sidebar('page-bottom');
    			echo thematic_after_widget_area('page-bottom');
    		}
    	}
    }

    -Gene

    Posted 4 years ago #
  8. Thanks em hr, That's exactly what I meant. Cheers

    Posted 4 years ago #
  9. Sorry for the multitude of crossposts, but I'm a bit desperate to find a resolution to a similar issue. I can't seem to get my page-bottom widgets to show up on the front-page or blog templates when using Feature Site. I tried to include the above function in my Feature Site functions.php file, to no avail. Can one of the mods take a look at this?

    http://forums.themeshaper.com/topic/thematic-feature-site-page-bottom-issue-on-front-page

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.