Recent Posts widget without Title

This code will set the title to an empty string if it is set to Recent Posts (Which as you noted, is what the Recent Posts widget will set the title to if it is empty): add_filter( ‘widget_title’, ‘wpse_widget_title’, 10, 3 ); function wpse_widget_title( $title, $instance, $id_base ) { if ( ‘recent-posts’ === $id_base && … Read more

How to change text widget title h2 to h1

The before-title and after-title arguments passed to register_sidebar() need to use underscores: register_sidebar(array( “name” => “Home Consulatation”, “id” => “home_consult”, “before_widget” => “”, “after_widget” => “”, “before_title” => “”, “after_title” => “” )); If you use that the titles won’t have any tags. You need to provide them to the before_title and after_title arguments, like … Read more

How to hack recent comments default widget?

Sounds like you just need to make another widget of your own in a plugin. So copy the complete code from the default widgets file, and change the class name, then just edit the code you’d like to edit. class YOUR NEW WIDGET NAME extends WP_Widget { // … foreach ( (array) $comments as $comment) … Read more

Can I remove a widget area without editing code?

No, is not possible, not in 99% of cases. Widget areas are added with a register_sidebar call in a php file. Until WordPress read that line, the widget area is registered. So, the the easiest and always available way to prevent a widget area is registered is remove (or at least comment out) that line. … Read more

Remove/Unregister or hide a widget added by a plugin

Thanks Stephen for helping me wrap my head around this today. Even though it’s something so small, I absolutely hate when develpers bloat plugins with crap you don’t want. I was very frustrated after WPengine, telling me it can’t be removed and that if I really want to remove it than I need to find … Read more

Too few arguments to function WP_Widget::__construct(),

You’re using an extremely outdated method of creating a widget. You should be using the __construct() function, not a named function, as the constructor, as documented. namespace App; class My_Widget extends \WP_Widget { function __construct() { $widget_ops = [ ‘name’ => ‘My widget’, ‘description’ => ‘My description’ ]; parent::__construct( ‘My_Widget’, ‘My widget’, $widget_ops ); } … Read more

Dynamic Sidebars On Multiple Subpages

More easy & elegant (higher maintainability): <?php // Your sidebar should have the wp_meta action hook wp_meta(); // in ex. your functions.php function my_sidebar_content() { // “About” Page if ( is_page(‘about’) ) { // If some widget is added via Admin > Design > Widgets if ( is_active_sidebar( ‘widgets-sidebar-default’ ) ) { // Display Widgets … Read more

Remove/Add widgets from/to the Available Widgets pool

You can use the function unregister_widget to remove widgets. E.g. you can remove the Calendar widget with: function my_widgets_init() { unregister_widget( ‘WP_Widget_Calendar’ ); } add_action(‘widgets_init’, ‘my_widgets_init’); To add widgets, use the Widgets API.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)