Forums

'includes' in wordpress (6 posts)

  1. techHT
    Member
    Posted 1 year ago #

    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

  2. raskull
    Member
    Posted 1 year ago #

    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_API

    Oh, you also have to add this to functions.php:

    add_filter('widget_text', 'do_shortcode');

  3. Andrea_r
    team pirate
    Posted 1 year ago #

    Or build your own widget with the php function in it.

    http://wpmututorials.com/plugins/build-your-own-widget/

  4. techHT
    Member
    Posted 1 year ago #

    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)

  5. techHT
    Member
    Posted 1 year ago #

    Andrea - did you have any thoughts...

  6. Andrea_r
    team pirate
    Posted 1 year ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic