ThemeShaper Forums » Thematic

[closed]

get rid of subsidiaries on certain page templates

(7 posts)
  • Started 3 years ago by j.dalen
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Can someone help me modify the above code to get rid of subsidiaries on certain page templates? I have already moved the subsidiary section under _belowmainasides (so it is within the main container, above the footer). The website under development is http://clearing.dalenhosting.com. You'll see the subsidiaries on the home page but want to get rid of the empty space on subsequent pages.

    I tried the below, but it's incorrect:

    // filter thematic_subsidiaries ... switch off on certain page templates and blog page
    function remove_belowmainasides() {
    // We test if we are on the front page
    if (is_page('standard') or is_single()) {
    // Yes, we are .. leave on
    return TRUE;
    } else {
    // we are not .. switch off
    return FALSE;
    }
    }
    // Connect the filter to thematic_subsidiaries()
    add_filter('thematic_belowmainasides()', 'remove_widget_area_subsidiaries');

    The dev site is http://clearing.dalenhosting.com

    Posted 3 years ago #
  2. him
    Member

    just reduce the footer height, and i think you will take care of the empty space. Works in firebug on your site.

    Posted 3 years ago #
  3. that code looks familiar to me.... though i am not sure thematic_belowmainasides is the right hook (i just dont remember off the top of my head right now). but try it again w/ fixing ehe error in your add_filter

    // Connect the filter to thematic_subsidiaries()
    add_filter('thematic_belowmainasides()', 'remove_widget_area_subsidiaries');

    should read

    // Connect the filter to thematic_subsidiaries()
    add_filter('thematic_belowmainasides', 'remove_widget_area_subsidiaries');

    note- the no () in the function names.

    you will catch errors like that if you use a text editor w/ syntax highlighting like notepad++, which is free. you should also turn on error reporting in your wp-config.php file as i'm surprised that one didn't kick up a php error w/ unexpected ) characters. open it, search for WP_DEBUG... it is currently set to false. set it to true while you are in development.

    Posted 3 years ago #
  4. thanks for the debugging tip! But still not sure how to 'hide' the subsidiaries area I created on the home page template, on the other page templates that I've created. Is there a way to call a page template into the css stylesheet?

    ie.

    .main_pagetpl #subsidiary {
    display:none;
    }

    I found this link which points me in the right direction...can someone help me figure out how to add a class to #main within this loop in the page template?

    <?php

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();

    ?>

    Posted 3 years ago #
  5. if you didn't mess w/ it you should have a whole slew of body classes

    for instance here is a page that is using a template called magazine on a page of mine:

    <body class="wordpress blogid-1 y2010 m09 d01 h09 home singular slug-blog page pageid-218 page-author-kathy page-comments-open page-pings-open page-template page-template-template-magazine-php windows firefox ff3">

    you will notice that there IS already a body class for a page that is using a page-template AND one for the specific template itself.

    if your template file is called template-home.php then your CSS would look like:

    .page-template-template=home-php #subsidiary {
      display: none;
    }
    Posted 3 years ago #
  6. perfect. thanks for the tip and feeling a bit foolish for not using View source on the pages to check for body classes generated. Thanks for your help, this is a very good tidbit of info for all future projects as well!

    Posted 3 years ago #
  7. cool. don't forget to mark this as resolved. there is totally a way to do this w/ functions and actually REMOVE the content versus just hiding it, i just can't figure it out quickly. even though gene has explained it to be several times i always struggle w/ the template conditionals.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.