Tag Info

Hot answers tagged

2

I got the following tutorial a very good start for a widget creation: How to Create a Custom WP Widget — WPBeginner And I used the tutorial and made my own first widget for my plugin. You can get all my code here in Github.


2

Nope, there is no way (thank I can think of) to do this cleanly. Handling of output and related parameters is up to the each wdiget's individual widget() method. There is no generic way to manipulate it. You could maybe get away with filtering widget save or display instances to force it to always have title (like a single space string for example), but ...


2

There isn't a standard way to do it AFAIK in the form() method; here's a function to do it: function wp158055_get_sidebar_id( $widget ) { foreach ( wp_get_sidebars_widgets() as $sidebar_id => $widget_ids ) { if ( array_search( $widget->id, $widget_ids ) !== false ) return $sidebar_id; } return false; } And call with $this. Note ...


1

One common way to do similar task is creating a page template. For example: <?php /* Template Name: Reviews and Quotes */ get_header(); ?> <div id="content"> <div id="reviews"> <?php $reviews = get_the_reviews(); foreach( $reviews as $review ) { <?php <div ...


1

This seems to test properly for me. function register_home_sidebar() { /* Register the new sidebar. */ register_sidebar( array( 'id' => 'home-sidebar', 'name' => __('Home Sidebar'), 'description' => __( 'This sidebar will display only on the homepage.'), 'before_widget' => '<aside id="%1$s" class="widget ...


1

Ok, finally the support team answered my question, and if even if there's not a real solution, suggested a workaround. Since the answer is buried deep in the vendor user forum - link here - I'm sharing the solution here, just in case someone has the same problem with this or another theme. Basically it's a bug in the parent theme (Toolset Bootstrap), that ...


1

I think I see the problem now. None of your links have a closing anchor tag which is cascading down until it hits the end at which point you close it on phone number: Your Code: echo '<a href="'.$facebook.'" target="_blank"><img src="'. get_stylesheet_directory_uri() .'/images/fb.png" height="24" width="24" alt="facebook">'; What it should ...


1

There is, in fact! The global variable $wp_registered_sidebars stores the registered sidebars, and $wp_registered_widgets stores all registered widgets (by widget ID).


1

You can use any of the parameters from wp_list_categories and the widget_categories_args filter You can style the output with these CSS selectors: li.categories { ... } li.cat-item { ... } li.cat-item-7 { ... } li.current-cat { ... } li.current-cat-parent { ... } ul.children { ... }



Only top voted, non community-wiki answers of a minimum length are eligible