Menu Shortcode
-
I am using a shortcode I created to pull my main nav menu into an area on my testimonials page. It seems to work, except it strips out all of the styling. How can I fix this?
Here is the page:
http://creatingpositivefutures.com/testimonials-new/Here is the code I am using:
function print_menu_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'name' => null, ), $atts)); return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) ); } add_shortcode('menu', 'print_menu_shortcode');Shortcode is:
[menu name="main"]
Viewing 4 replies - 1 through 4 (of 4 total)
-
Try adding
container_classwithfusion-main-menuon the shortcode.function print_menu_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'name' => null, ), $atts)); return wp_nav_menu( array( 'menu' => $name, 'echo' => false, 'container_class' => 'fusion-main-menu' ) ); } add_shortcode('menu', 'print_menu_shortcode');Cheers,
SeptianThanks! Will try.
-
This reply was modified 9 years, 8 months ago by
Squidpeg9.
Ok that almost did it – applied the inline and all, now just need to get rid of the bullet points. I added ‘menu_class’ => ‘fusion-menu’ and ‘menu_id’ => ‘menu-main’, but neither seems to help. Any ideas?
Does anyone else have any ideas on this?
-
This reply was modified 9 years, 8 months ago by
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Menu Shortcode’ is closed to new replies.