rajoo_sharma
asked on
WordPress - how to display custom menu in a theme?
Hi,
I'm using WordPress 3.0.5, I added a menu called "Top Menu" through WP-Admin-> Appearance->Menus
I added some pages to it, how can I display it in the header of my theme? Is there any function to call such custom menus?
Thanks
I'm using WordPress 3.0.5, I added a menu called "Top Menu" through WP-Admin-> Appearance->Menus
I added some pages to it, how can I display it in the header of my theme? Is there any function to call such custom menus?
Thanks
ASKER
Hi,
Thanks for the reply. I'm new to WordPress so my queries could be really stupid :)
1. I've two custom menus "Top Menu" and "Bottom Menu"
2. I added the following code in the header.php
4. Adding or removing this piece of code
Regards
Thanks for the reply. I'm new to WordPress so my queries could be really stupid :)
1. I've two custom menus "Top Menu" and "Bottom Menu"
2. I added the following code in the header.php
<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>
3. It always shows me the Top Menu, how can I get a menu by name or ID?4. Adding or removing this piece of code
add_theme_support( 'menus' );
at the end of the functions.php makes no difference. The menu always appears.Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Thanks for such a great detailed explanation. I could achieve what I wanted.
I've one more query related to displaying select Page's/Post's teaser in a block using admin. How can I accomplish this? e.g. a video on a home page or teaser of about us page on home page in a block / region.
Should I post another question for this?
Regards
Thanks for such a great detailed explanation. I could achieve what I wanted.
I've one more query related to displaying select Page's/Post's teaser in a block using admin. How can I accomplish this? e.g. a video on a home page or teaser of about us page on home page in a block / region.
Should I post another question for this?
Regards
You could use the featured image feature to achieve this. Here is a link to a good source. Let me know if you have any questions.
http://ponderwell.net/2011/02/wordpress-featured-images-and-custom-thumbnail-sizes/
http://ponderwell.net/2011/02/wordpress-featured-images-and-custom-thumbnail-sizes/
ASKER
Thanks again,
I'll surely post questions as I've just started using WordPress :).
Regards
I'll surely post questions as I've just started using WordPress :).
Regards
ASKER
Thank you for such an accurate solution.
You're welcome. Let me know if you run into any problems with the featured image hack.
Open in new window
If it isn't activated try adding this just before the closing ?> PHP tag in the functions.php file along with the code above for the header.php:
Open in new window