I have a theme called 'progressive'. It has a sub theme called 'progressive_sub'.

I'm trying to exclude items from being displayed from a particular page in D7 (latest as of 12.2.15).

I have the following useful files:


This contains:


 * Implements hook_preprocess_page().
function progressive_sub_preprocess_page(&$variables) {
  $path = request_path();

  if ($path = 'node/131') {
    $variables['theme_hook_suggestions'][] = 'page';

You can see that I'm trying to remove a heap of regions from this page (page.tpl.php) template, in this case when /node/131 is called.

I also have:


which has all the usual including:

<?php print render($page['content']); ?>

My problem is that I cannot get this page.tpl.php to load when I'm viewing /node/131

Is there something that I'm doing wrong?

  • Have you tested something simple in your sub theme to test it is working?
    – Alex Gill
    Commented Feb 12, 2015 at 16:22

2 Answers 2


Wy don't you just create a template with this name:


and then, rather than removing regions in your template_preprocess_page function, just do not print them in your new template.

A few other things:

In some cases where order matters you may consider adding the suggestion to the beginning of the array using array_unshift.

Making use of request_path() is not the best way to get the path. It returns the request url, which may or may not be the internal path (think aliases). Better to use menu_get_object.

  • Thanks. This was a much simpler suggestion which worked out. I appreciate your help.
    – njwrigley
    Commented Feb 13, 2015 at 7:17


if ($path = 'node/131')

should surely be

if ($path == 'node/131')

Nevertheless this should not affect use of page.tpl.php.

Is your subtheme working at all, do templates get loaded from subtheme at all?

Your path is /sites/all/themes/progressive/progressive_sub. Does that mean the parent theme is at /sites/all/themes/progressive? If so, maybe try to give the subtheme a separate folder.

  • /sites/all/themes/progressive is where the main theme is, and /sites/all/themes/progressive/progressive_sub is where the sub theme is. The theme works perfectly, all pages load as I'd expect.
    – njwrigley
    Commented Feb 12, 2015 at 16:05
  • from your code your page.tpl.php should be loaded with every page load since your if condition is always true. So if the page.tpl.php gets never loaded there might be something wrong with the subtheme. So check out first if any template in your subtheme get loaded at all. Commented Feb 12, 2015 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.