Tagged: custom widget area, sidebar
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
Do 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.
So 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.
Hi!
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,
Josue
I like the idea of not relying on the plugin. I will check that out this weekend. Thanks.
We looking forward to hearing from you :)
Regards,
Josue