Second level of navigation on page?

Discussion in 'WordPress' started by ttmt73, Mar 15, 2012.

  1. #1
    I'm still new to WP and I'm trying to get my head around the fundamentals - this could be a really stupid question.


    I'm trying to create a Photo Gallery theme (I know there are lots available, but none do what I want.) I want my site to have sections inside of which will be galleries. In the demo I have Transport as a section which contains the galleries Boast, Planes and Cars.


    http://www.ttmt.org.uk/wordpress


    I was thinking that each section should have a page and each gallery be a post.
    Therefore I have a page for Transport that uses the page template transport.php.
    I have posts for Boats, Planes and Cars each has a category of transport and contains a NextGen slideshow gallery.


    In transport.php I have a query_posts that gets all the posts with a category of transport and displays them as links. The links then link to the posts that are shown in single.php.


    On single.php the links to Boats, Planes and Cars are gone - I know it's because there's no query in single.php.


    My questions after all this explanation is how do I keep the links for Boats, Planes and Cars at the top of the page? Do I need to create a page for each gallery, so a separate page for Boast, Planes and Cars?


    This is a plain html demo of what I was hoping to achieve.


    http://www.ttmt.org.uk/wp


    Can anyone tell me if this is possible with WordPress


    If it's not I know not to waste anymore time with it.
     
    ttmt73, Mar 15, 2012 IP
  2. AlohaThemes.com

    AlohaThemes.com Active Member

    Messages:
    128
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #2
    Your link is dead :(

    Anything is possible with WordPress. If you are new to this, I would recommend finding a theme that already suits your needs.

    Let me try to clarify a couple things for you:

    Single.php is used to display a single post's content. This is why you are not seeing a list of links, as when you were viewing the category. The category, perhaps using category.php or archive.php, is designed to display all the posts (or just the titles in this case) for a category.

    Check out this image to follow the flow of WordPress' template system: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png

    If you wanted the 3 links to be at the top of every page, you have some options. Forgive me as I am not exactly clear as to what you are after, but in general these apply:

    1. If your theme uses the new WP custom menus, you could add them to the menu bar using the custom link option
    2. You can hardcode them into single.php file - (if you wanted them on every page, you could code the links into your header.php file)
    3. You could add a sidebar widget for recent posts (would be in the sidebar, versus the top of the page)

    Anyways, hope that helps you out :)

    - Scott
     
    AlohaThemes.com, Mar 17, 2012 IP
  3. ttmt73

    ttmt73 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    AlohaThemes.com sorry for the dead link I had posted on the Wordpress forum but got on response, I never get a response on there.


    I did look for a theme but after 2 days I couldn't find anything that fitted


    I have moved on a bit now and got it working apart from one small point I'm hoping you might be able to help with.


    http://www.ttmt.org.uk/wordpress/


    I have a page for each gallery now - cars, planes and boats are children pages of Transport.


    When you click on Transport the child pages are shown.

    I'm using this code to do this

    
    <?php
      global $post; // Setup the global variable $post
      if ( is_page() && $post->post_parent ) // Make sure we are on a page and that the page is a parent
          $children = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
          $parent = $post->post_parent;
      else
          $children = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );
    
    
      if ( $children ) {
          echo $parent;
          echo '<ul class="secondary">';  
            echo $children;
          echo '</ul>';
      }
    ?>
    
    Code (markup):


    My problem now and the last thing I need to work out is how add a link to the parent page with the child links. So on the gallery page I would like Transport, cars, planes, boats as links.

    Any help with this would be greatly appreciated.
     
    ttmt73, Mar 17, 2012 IP
  4. AlohaThemes.com

    AlohaThemes.com Active Member

    Messages:
    128
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #4
    AlohaThemes.com, Mar 17, 2012 IP