Skip to content

Instantly share code, notes, and snippets.

@invmatt
Created February 8, 2014 22:52
Show Gist options
  • Select an option

  • Save invmatt/8891547 to your computer and use it in GitHub Desktop.

Select an option

Save invmatt/8891547 to your computer and use it in GitHub Desktop.
Checks to see if the hierarchical submenu returns anything. If true output the left column else give the content a full width class.
<?php
$submenu = hierarchical_submenu($post);
if (!empty($submenu)) {
echo '
<div class="sidebar col-3-12">
'. $submenu .'
</div>
<section id="content" class="col-9-12" role="main">
';
} else {
echo '
<section id="content" class="col-1-1" role="main">
';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment