Filter on widget-title does not work with custom links

The “Links” widget uses wp_list_bookmarks, which outputs a nested list similar to: <li> <h2>[category]</h2> <ul class=”xoxo blogroll”> [links] </ul> </li> You can override [category] using the link_category filter: function wpse_147543_link_category( $title ) { $title=”title”; return $title; } add_filter( ‘link_category’, ‘wpse_147543_link_category’ );

Confused about customising widgets

What you have used is actually pretty obsolete remnants of “old” widget implementation. The current implementation of widgets in WordPress is using new, class-based approach, see Widgets API in Codex. There isn’t really designated way to “customize” functionality of existing widget. Depending on circumstances you might be able to use hooks in its code. Outside … Read more

widget exclude post by custom field

The meta_query parameter in WP_Query allows you to query posts that don’t have a certain custom field. Furthermore, you can check for multiple custom fields. With two queries in meta_query, you can fetch all posts that either don’t have a custom field, or have it set to 0: ‘meta_query’ => array( ‘relation’ => ‘OR’, array( … Read more

Using AJAX in WordPress Widget

AJAX/jQuery is not limited to any specific “area” like plugins or widgets, in fact some plugins consist solely of widgets (although afaik the converse cannot be said). This Smashing article might be a good primer. When you finish with that then check out Gary Cao’s WordPress + AJAX tips and come back with a more … Read more

adding image in the header of my dev widget

From your post what i understood is u need to show images saved in your plugin folder.if yes then you can go with plugin_url to link images in a plugin directoy without specifying the plugin folder name. Example: <?php echo ‘<img src=”‘ . plugins_url(‘/images/header-background.png’, __FILE__) . ‘” > ‘; ?> The ouput will be like … Read more

WP_query returns error when used for custom widget

UPDATE: Okay, Looking at the Error, it should be easy. Just remove any Whitespaces or Clear Lines at the end of your Plugin file after the last “?>”. http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Did you copy&paste the code here? Because it seems like you have some whitespaces that should not be there in the line <?php if ($the_query->have_posts()) : … Read more