ThemeShaper Forums » Thematic

[closed]

Adding Categories and Moving Pages in the Menu

(2 posts)
  • Started 4 years ago by daviemanchester
  • Latest reply from daviemanchester
  • This topic is not resolved
  1. daviemanchester
    Member

    Hi

    Just started using Wordpress and Thematic. Its the first theme I tried and it looks like I pick the right one. Im very impressed with the support and information available on this forum.

    However Im just currently a little stuck with some changes I want to make.
    Im using a child thematic theme.

    1. On my home page I want to show a single page not 'posts'.
    Ive sorted that by using the admin interface and creating a new page and making this the front page in the settings.

    2. Ive then removed the 'posts' from any page.

    3. But I want to add links to the menu that direct to the the post categories such as 'New Posts' > '...com/?cats=1'
    Looking at some other posts, I know I should be using stuff such as;
    function child_add_menu_items($output) {
    ....
    }
    add_filter('wp_page_menu','child_add_menu_items');
    and
    wp_list_categories(.... (somewhere)

    But Ive not been able to get it quite right. Can anyone help?

    4. I also want to add some other pages to the menu bar but dont want this code to have an affect on the links above.

    Thanks in advance!

    Dave

    Posted 4 years ago #
  2. daviemanchester
    Member

    Hi

    I have now tried the following code;

    function remove_thematic_access() {
    remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_access');

    function my_category_access() { ?>
    <div id="access">
    <div class="skip-link">"><?php _e('Skip to content', 'thematic'); ?></div>
    <div class="menu">
    <ul class="sf-menu">
    <?php wp_list_categories('title_li=') ?>

    </div><!-- .menu -->
    </div><!-- #access -->
    <?php }
    add_action('thematic_header','my_category_access',9);

    function child_add_cat_menu($cat_menu) {

    $search = array('/<li class="categories">/','/

      /',"/<\/li>$/");
      $replace = array('<ul class="sf-menu"><li class="categories">','','');
      return preg_replace($search, $replace, $cat_menu, 1);
      }
      add_filter('wp_list_categories','child_add_cat_menu');

      That I found on this post;
      http://forums.themeshaper.com/topic/menu-navigation

      Is there no a more simple way that doesnt use the wp_list_categories as I notice this returns an ordered list (UL etc..) which is replaced to show the categories as main navigation points.

      Could get_categories be used to grab and array and used in a simpler function?
      Plus I dont want to loose the standard page menu items I have added.

      Thanks

      Dave

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.