Custom shortcode in widget forced to top of widget

For shortcodes you have to return the output for it to be written out where the shortcode appears. Either turn your HTML into a PHP string rather than breaking out of the PHP tags or you can use PHPs output buffering methods like so: ob_start(); ?> <div id=”player_<?php echo $id; ?>” class=”video_player”><a href=”http://www.adobe.com/products/flashplayer/”>Get the Flash … Read more

Add copies of the same text widget instance to multiple sidebars

A possible solution would be to enable shortcodes in the Text Widget. add_filter( ‘widget_text’, ‘do_shortcode’, 11 ); Then put the same shortcode (i.e.: “[business_hours]“) in all text widgets, and all of them will display the same content. It’s even possible to add some Conditionals Tags inside the shortcode definition to show different things according to … Read more

Is There A Hook To Process The Content Of The Text Widget?

Filter widget_text (for the text) widget_title (for the title) Example function add_smiley($content) { $new_content=””; $new_content.= $content . ‘:)’; return $new_content; } add_filter(‘widget_text’, ‘add_smiley’); Note that this works only for the content so not if you have a widget with only a title. Reference http://codex.wordpress.org/WordPress_Widgets https://stackoverflow.com/questions/1385954/do-wordpress-widget-or-sidebar-hooks-exist https://stackoverflow.com/search?q=wordpress+widget

Can the new 4.8v text widget visual editor be removed?

The answer is mostly no. The “enhanced” text widget was designed to work like the post editor as much as possible, including autop which might break whatever HTML that can not stand the conversion of lines into paragraphs. Several people have released plugins to restore the former functionality, but 4.8.1 will also include an “code” … Read more