SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Call a custom menu into a page.

    Hey there,

    I'm working on this art gallery website,
    I created a custom template for my "artists" page, and I want to call a custom menu that I created specifically for this page called "Artists".
    This menu will list all the names of the artists in our gallery.

    I want the page to look like that:
    artists.jpg

    Every link in the menu will have the featured image of the page as the thumbnail and the pages title as the artists name.
    I did that because it seemed to me like a reasonable way to make the addition of artists flexible on that page,
    you'll basically only need to create a page then add it as a link in "Artists" menu then it automatically appears on the page, let me know if you think there is a better way to make it.


    Now I'm having a problem with calling the right menu, is the code that I found wrong?

    Code:
    <?php 
    
    /*
    Template Name: Artists page
    */
    
     get_header(); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    						
    			<?php $menu = wp_get_nav_menu_object( “artists”);
    
    			echo $menu->artists;
    			
    			wp_nav_menu(array(“menu”=>”artists”)); ?>
    		
    		<?php endwhile; endif; ?>
    
    <?php get_sidebar(); ?>
    	
    <?php get_footer(); ?>
    Now this shows the Main navigation menu instead of "Artists" menu, does it matter if the value is upper/lower case?
    And also will I be able to style it and make the featured image appear as the thumbnail and the whole menu in 3 column?
    This custom menu won't have sub-level pages.

    Please help, it would be greatly appreciated, thank you in advance!

  2. #2
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OKAY I found how to call a specific menu,
    Code:
    <?php wp_nav_menu( array('menu' => 'Project Nav' )); ?>
    now how can I add the featured picture to show as the thumbnail for every page's link?

  3. #3
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nobody knows the answer?


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •