ThemeShaper Forums » Acamas

[closed]

Navigation Menu Items that link to specific Category

(4 posts)
  • Started 14 years ago by Zack Gemmell
  • Latest reply from Lasson
  1. I am working on a site for a chef and he has three categories in his blog: accolades, recipes and cooking series. Is it possible to add these into the navigation menu where they would link to the category view for that specific topic.

    I did find a solution that involved the functions.php file but that created a whole new navigation menu that erased all the other sections.

    The website can be found here: http://www.zackgemmell.com/peteredwards

    Thank you for your help and your amazing Wordpress theme.

    Posted 14 years ago #
  2. I wonder if this would be accomplished best using custom page templates?

    Posted 14 years ago #
  3. Hi Zack,

    I think the best way to do this would be to write a function that replaces the thematic navigation with one to your liking. Changing the page templates is the wrong way to go about it since the navigation function is in the header.php.

    It is entirely possible to create a custom menu function that combines pages and categories, by using wp_list_pages and wp_list_categories in the same <ul>

    But... the new menu management feature coming in WP 3.0 is designed for exactly this kind of thing. Unfortunately, WP 3 isn't due out for another month or so. When It gets released you could simply create your own navigation function that calls the new wp_nav_menu()

    There is an easy but inelegant way to accomplish what you want until WP 3 launches... You could hack the menu together by using the "Page Links To" plugin and create a few dummy pages to link to the category archives.

    -Gene

    Posted 14 years ago #
  4. Lasson
    Member

    I think I did what you refer to using custom page templates.

    Used this:

    function recent_pub(){
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name=publications&showposts=6&paged=' . $paged);
    while (have_posts()) : the_post(); ?>
    	<div id="belowlist" class="hentry">
    		<?php echo get_post_meta($post->ID, "dd_no", true);
    		thematic_postheader();?>
    		<div class="entry-content">
    <?php thematic_content(); ?>
    
    		</div>
    		<?php thematic_postfooter(); ?>
    	</div><!-- .post -->
    <?php endwhile;
    thematic_navigation_below();
    wp_reset_query();
    }

    adding the function just after <!--post--> in the template.

    Then I forced people to the page rather than then category by using a site wide redirect from /category/publications/ to /publications/ (for example for when someone press the link "posted in publications")

    Posted 13 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.