'includes' in wordpress
-
I installed wp3 in my root directory where my existing site is and have made them ‘play well’ together. My existing site is html with quite a few includes… specifically the navigation (main menu)
I can’t do ‘includes’ within a ‘text’ widget. I’d like to pull in my menu via an include within a widget. That way any sub-site use the main menu without having to code anything.
Editing individual themes or building (recreating) the menu with a ‘menu widget’ is tedious & unsustainable as more sub-sites are added
Any recommendations/advise
-
You can put a shortcode in a text widget. So make a function in functions.php to create the navigation and shortcode it.
http://codex.wordpress.org/Shortcode_APIOh, you also have to add this to functions.php:
add_filter('widget_text', 'do_shortcode');Or build your own widget with the php function in it.
Thanks Andrea
It’s taken a couple days for me to get back at it
I adjusted the widget code as per ‘comments’
Uploaded but when I activated it I got the following error:The plugin generated 988 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
What do you think? (I use the ‘feedpress’ plugin)
Andrea – did you have any thoughts…
Without know what exactly you did, it’s impossible to tell.
(use pastebin or a download link, don’t post all the code in the forum).
The topic ‘'includes' in wordpress’ is closed to new replies.