Tagged: custom widget area, sidebar
-
AuthorPosts
-
January 17, 2014 at 6:14 pm #211310
Is there an easy enough way to pull the Widget Nav Menu from the sidebar and place it in a Custom Widget Area so it can be used in a full width layout or color section?
Looking around in the PHP code a little bit to see if I can pull it form somewhere, but thoughts I’d ask here as well.
Thanks for any help.
-Nate
January 17, 2014 at 6:53 pm #211335Do I simply just echo $av_sidebar_menu in a custom widget? I identify the menu (I think) in the sidebar.php and that’s where I start to get a little lost.
Thanks.
January 18, 2014 at 12:02 am #211434So I ended up with a rough solution I think. Let me know what you think.
I installed the PHP widget plugin. http://wordpress.org/plugins/php-code-widget/
Created a Custom Widget Area
Pasted in the sidebar code:<?php echo "<div class='EAsidebar sidebar sidebar_".$sidebar." ".$sidebar_smartphone.">"; echo "<div class='inner_sidebar extralight-border'>"; $av_sidebar_menu = avia_sidebar_menu(false); if($av_sidebar_menu) { echo $av_sidebar_menu; $default_sidebar = false; } echo "</div>"; echo "</div>"; ?>Then placed the Custom Widget Area in the avia layout
Here is the result with a little tweaking of CSS. http://rev.greatercea.org/?page_id=2386
Kinda rough like I said but think it got the job done. Let me know your thoughts and if you see a cleaner approach. Always like to hear about best practices.
Thanks.
January 18, 2014 at 12:10 am #211435Hi!
Another approach would be using a Shortcode. If your current solution works for you, stick with it, the only drawback is see is the plugin dependency but i don’t think that’s a big deal.
Regards,
JosueJanuary 18, 2014 at 12:21 am #211439I like the idea of not relying on the plugin. I will check that out this weekend. Thanks.
January 18, 2014 at 12:21 am #211440We looking forward to hearing from you :)
Regards,
Josue -
AuthorPosts
- The topic ‘Place Widget Nav Menu into Custom Widget’ is closed to new replies.
