• Hi!

    I have my graduate guide advice tip site here:

    Business Bird

    …and am having some thoughts on navigation!

    I would like the posts under each category to be listed vertically underneath when the category is clicked on in the ‘Pick a Category’ sidebar box.

    When two categories are opened up I would like the other to close so the left hand bar does not get over crowded.

    I have this is my sidebar.php-

    <?php // Menu for subpages of current page
    		// Only shows if the current page has subpages
    		if($post->post_parent) {
    			$parent = wp_list_pages("title_li=&include=".$post->post_parent."&echo=0");
    			$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
    		} else {
    			$parent = wp_list_pages("title_li=&include=".$post->ID."&echo=0");
    			$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    		}
    		if ($children) {
    			echo '<h3 class="pages">Sub Pages</h3>';
    			echo '<ul class="navigation">';
    			echo $parent;
    			echo $children;
    			echo '</ul>';
    		} // End Subpage menu ?>
    
            <?php // Category Navigation ?>
            <h3 class="folder">Skill Topics</h3>
            <ul id="navigation">
              <?php wp_list_categories('depth=2&title_li='); ?>
            </ul>
            <?php if (is_single() && function_exists('related_posts_by_category')) {
    			$home = get_bloginfo("home");
    			echo '<h3 class="related">Related Articles</h3>';
    			echo '<div id="related">';
    			echo '<ul>';
    			related_posts_by_category(
    			  array(
    				'orderby' => 'post_date',
    				'order' => 'DESC',
    				'limit' => 5,
    				'echo' => true,
    				'before' => '<li>',
    				'inside' => '',
    				'outside' => '',
    				'after' => '</li>',
    				'rel' => 'nofollow',
    				'type' => 'post',
    				'message' => '<li><a href="'.$home.'">Sorry, no matches.</a></li>'
    			  )
    			);
    			echo '</ul>';
    			echo '</div>';
    		}?>

    Could you please let me know if there is more code hidden somewhere?

    Thank you!!

    Leon

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Leon,

    Not 100% sure what you mean, but check here and let me know if what is in the right hand bar for the bottom 5 links is the functionallity you are after.

    Thanks.

    Thread Starter businessbird

    (@businessbird)

    Hey!

    Thanks for your quick reply.

    Yep, that is the kind of thing! It looks amazing..

    Leon

    Ok, that was done using a combination of JS (for the sliding menu) and PHP (to add the class ‘visible’) –

    <? $cat = wp_get_post_categories($post->ID); ?>
    
    <li><h2><a href="#">Partners</a></h2>
        <ul<? if(in_array(69, $cat)){ ?> class="visible"<? } ?>>
            // You Code Here
    
    </li>

    Obviously there is some CSS involved, but it’s pretty basic. I can’t really give more as the code is fairly well embedded into the site, but I would suggest searching the plugins and google for ‘sliding menu’ or ‘sliding sidebsr’, as there are lots of ready to use results there.

    Thanks.

    Thread Starter businessbird

    (@businessbird)

    Sounds like plan!

    Is there one you would recommend? I have found lots of wierd and wonderful things for images etc. and toolbars along the top. Also I believe the theme my site was based on is not widget ready, would you happen to know if this would be an issue?

    Thanks for your help, it is really great!

    Thread Starter businessbird

    (@businessbird)

    Number 8 looks good! But a Widget..

    or

    this but it could be hard to get it to populate my categories -> posts

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hmm.. Is this possible please?’ is closed to new replies.