Articles of widgets

How do i export the HTML from text widgets?

I placed HTML in several text widgets which where lost after i deleted all inactive widgets and changed themes but i have found the data in the tables. The only problem, its mixed in with all this other crap code and i only want the HTML or text. All the export options don’t allow for […]

Add individual <hx> tag to widget title in sidebar

In my sidebar every widget title is enclosed in <h2> tags. I use 4 widgets in my sidebar and I’d like to have the first 2 widget titles as <h2> and the other 2 as <h4>. I changed in my function.php as given below: ‘before_title’ => ‘<h4>’, ‘after_title’ => ‘</h4>’, but that changes all titles. […]

Cannot save widgets in custom sidebars

I’m working on a child theme of the Toolset Bootstrap Theme. I need to create a custom sidebar, so I registered the new sidebar in my child theme’s function.php file: function wpbootstrap_register_newsidebar() { /* Register the new sidebar. */ register_sidebar( array( ‘id’ => ‘sidebar-999’, ‘name’ => __( ‘Home sidebar’, ‘wpbootstrap’ ), ‘description’ => __( ‘This […]

I wrote my plugin. How to display the result of the plugin's function to sidebar (widget?)?

I wrote my plugin. How to display the result of the plugin’s function to sidebar (widget?)? <? function register_form () { global $post; $test = “testesttest”; var_dump(“testtest”); return $test; } add_action( ‘get_header’, ‘register_form’ ); ?> How to display the sidebar this text via the admin panel of wordpress? get it done through a widget? need […]

Why use dynamic_sidebar() conditionally?

In the codex example of displaying sidebars, what is the significance of the conditional wrapping around the call to dynamic_sidebar? Why do this: <?php if ( dynamic_sidebar(‘example_widget_area_name’) ) : else : endif; ?> this seems to work ok: <?php dynamic_sidebar(‘example_widget_area_name’); ?> Thanks, Toby

Displaying a variable stored in functions.php inside widget

I’m trying to display a variable that is stored inside my functions.php file – for the sake of the question this variable is stored as $test = ‘test’;. When i use echo $test inside page.php, header.php or any other file the value is returned however when i try to do the same inside a widget […]

wp_register_sidebar_widget() disappered my Widgets submenu – what am I doing wrong?

Working on a theme made by someone else as an official duty. At first it’s causing error in the wp-admin Widgets page — not working at all. Then the first thought came to my mind was debugging… Debugging steps » Activated WP_DEBUG. » Deactivated all the plugins. » Switched to default theme ‘T13’. Errors Found […]

Hide default “Recent Comments” Widget if there are no comments yet

Is there a way to hide the widget completely if there are no comments yet? I was thinking about maybe adding a php function to my functions.php file – is that a possible way? If so, can someone provide a suggestion?

Hide all Dashboard Widgets (not remove)

Is there a to hide all dashboard widgets, not remove them? I want my widget to be the first widget but according to the docs there’s no way to specify where your widget shows up since it’s all “core”, so my solution would be to hide all widgets initially. I ran across this but this […]

Post-specific widgets in WordPress 'Twenty Fourteen' theme

Using WordPress 3.8.1 with ‘Twenty Fourteen’ theme I’d like to arrange my post in such a way that it’s main contents go to main (center) column while galleries, attached files and links pertaining to this post go to content sidebar to the right. How can I do that? Do I need some specific plugins? Right […]