Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = explode('/',$_SERVER['REQUEST_URI']);
- $dir = $url[2] ? $url[2] : 'UX-Style-Guide';
- $result = str_replace ("?", "", $dir);
- $final = current(explode('=', $result));
- $style = str_replace ("-", " ", $final);
- $style = ucwords($style);
- $post_id = $post->ID;
- $class = '';
- ?>
- <!-- THIS IS THE LEFTNAV -->
- <nav id="verticalNav" class="ui-side-nav-drawer">
- <div class="cssmenu">
- <div id="entry-search">
- <input type="text" placeholder="Search Styleguide Entries" class="fuzzy-search" />
- </div>
- <ul class="list">
- <?php
- $nav_cat_args = array(
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'child_of' => 0,
- 'exclude'=> 1
- );
- $nav_categories = get_categories($nav_cat_args);
- $displayedPosts = array();
- foreach($nav_categories as $category) {
- echo "<li><span class='navAppTitle'>" . $category->name . "</span></li>\n";
- $nav_post_args = array(
- 'numberposts' => -1,
- 'category' => $category->term_id,
- 'post_type' => $final,
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'child_of' => 0
- );
- $nav_posts = get_posts($nav_post_args);
- $childcats = get_categories('child_of=' . $nav_categories . '&hide_empty=1');
- foreach($nav_posts as $post) {
- if (in_array($post->ID, $displayedPosts)) {
- continue; //Skip this post if it has already been displayed once.
- }
- $displayedPosts[] = $post->ID;
- $class = '';
- if ($post_id == $post->ID) {
- $class = 'entry-title current';
- } else {
- $class = 'entry-title';
- }
- echo "<li class='$class'>";
- echo "<a class='entry-link' href='";
- echo the_permalink();
- echo "'>";
- echo the_title();
- echo '</a>';
- echo "</li>\n";
- foreach ($childcats as $childcat) {
- if (1 == $childcat->category_parent) {
- echo "\t" . '<li><a href="' . get_category_link($childcat->cat_ID).'" title="' . $childcat->category_description . '">';
- echo $childcat->cat_name . '</a>';
- echo '</li>' . "\n";
- }
- }
- }
- }
- ?>
- <?php wp_reset_query(); ?>
- <div id="job-listings">
- </div>
- </ul>
- </div>
- </nav><!-- /END #verticalNav -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement