Seeking A Plugin To Insert Shortcode Output In or Above Header

Hello,

I am seeking a plugin that can insert shortcode output into or above the Header area.

The thread below explains adding shortcode output to a theme to accomplish this, but I prefer a plugin to accomplish this if possible so the feature is not lost with a theme change.

https://premium.wpmudev.org/blog/daily-tip-how-to-insert-shortcodes-into-a-wordpress-theme/

I have tried several Header /Footer and Ad Inserter plugins, but have not found one that renders shortcodes above the Header area or in the header area.

This is what we want...almost.

http://worldmoodukkwan.com/70th-anniversary-registration/

The timer needs to appear above every page and the text needs to be centered, however, the plugin that generates the timer does not provide any way to modify the text.

So close... yet so far away. :slight_smile:

Plugin solution?
Alternate approach?
Suggestions, help?

Thanks!

  • Tyler Postle

    Hey SooBahkDo,

    Hope you're doing well today!

    I tried some plugins myself including our own global header module inside Ultimate Branding, but it didn't render shortcodes either.

    I think your best bet is to just place it in the theme file. If you use a child theme then you don't have to worry about the edit being overwritten :slight_smile:

    Create a child theme and then copy your header.php file into it and paste in this code with your shortcode:

    <?php echo do_shortcode('[my-shortcode]'); ?>

    Then you will be good to go :slight_smile:

    This will let you know how to setup the child theme: http://codex.wordpress.org/Child_Themes

    Let us know if you need any further assistance with that.

    All the best,
    Tyler

  • SooBahkDo

    Hi Tyler,

    We are using a child theme for Blogs MU.

    This was a clear article about using shortcodes everywhere ... except the header.

    http://stephanieleary.com/2010/02/using-shortcodes-everywhere/

    This plugin allows the selective activation of shortcode functionality in various locations... except the header.

    https://wordpress.org/plugins/shortcode-exec-php/

    HOWEVER, I finally found this plugin that allows PHP and other code execution in the Header, so we can use the code snippet you provided AND we can add HTML to the text title that we need to appear above the timer. All this is done in the settings of the plugin without needing to modify theme code.

    Header and Footer

    https://wordpress.org/plugins/header-footer/

    So the Header Footer plugin can be configured to accomplish the desired goal and thus preserve the configuration even if we switch to an entirely new theme.

    This is exactly what I was looking for!

  • SooBahkDo

    This plugin also seems to be a solution that renders shortcodes above the header area and it looks very flexible. Video demo

    Easy Heads Up Bar
    https://wordpress.org/plugins/easy-heads-up-bar/

    This plugin applies your added header content globally to every site on the network but I have not tested to see if it will render shortcodes. It also allows other insertion points.

    WPMS Network Global Inserts
    https://wordpress.org/plugins/wpms-network-global-inserts/

  • SooBahkDo

    Hi Tyler,

    Thanks.

    The one thing I learned was that I was using the wrong search terms to try locate a solution. While displaying a timer in the "header area" or above the "header area" was the goal, the terms I needed to have been using were "notification" and "bar" or "notification bar" as those terms produce a whole bunch of potential plugins that can display something in the header area. However, I only found one so far that could render shortcodes and thus display the timer I wanted to show.

    While the plugin Header and Footer certainly provides a solution it has a TON OF OTHER FEATURES that are way overkill when all you need is to display a message or timer throughout your site or on selected pages. This is an excellent plugin to keep in your toolbox for much mores sophisticated needs. It is far more versatile than Header Footer Commander and some other header/footer plugins I tested.

    Header and Footer

    https://wordpress.org/plugins/header-footer/

    So far my experience is that Easy Heads Up Bar is very easy to implement and it renders shortcodes so you can put anything in it. It creates a more prominent notice bar (larger overall elements) than some others. It provides the TinyMCe editor for designing content to display in the bar, but my experience is that it strips out all formatting and only displays the text with the color options that it allows you to set in some selector fields. However the editor does allow position of the shortcodes as preferred in relation to the text, etc. It also does not provide any show/hide display options that WPFront Notification Bar does but does allow top or bottom positioning and display limited to all pages or interior pages or home page only. Users can also manually hide or unhide the bar and you can schedule when it appears and disappears.

    It is quick and simple solution.

    Easy Heads Up Bar
    https://wordpress.org/plugins/easy-heads-up-bar/

    You can see it in action at http://www.wmdk.com (until 03/15/2015 - not sure about after that)

    The plugin WPFront Notification Bar displays a smaller notification bar (smaller overall elements) and can display a nice gradient effect on the bar whereas Easy Heads Up Bar does not provide a gradient effect. It can display a block of html and a button (that can execute javascript) and has a custom css feature built in, but it is a bit less flexible than Easy Heads Up Bar in what it can display because it cannot render shortcodes.

    However, it allows you to select the pages it appears on or the user roles it will display for, when it closes, how long it stays closed, display after scroll, top or bottom positioning, variable height and enable/disable button and a few other display tweaks. Users can also manually hide or unhide the bar and you can schedule when it appears and disappears.

    WPFront Notification Bar
    https://wordpress.org/plugins/wpfront-notification-bar/

    Also a very nice solution, but does not render shortcodes, so it got beat out by Easy Heads Up bar for this application.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.