Articles of widgets

I can't edit my homepage – the page editor is just blank

I’ve been tasked with taking over the website for my company – going well for the most part, but I’ve hit a wall with the homepage. I’m trying to update the Latest Issue widget Problem is, when I go to the page editor it comes up blank: I was wondering if anyone has some suggestions? […]

Search widget will search everything in the site, how to limit to only search gallery name

I am using the default search widget in sidebar, the problem is , it will search every text in the site. I would like to make different search widget, e.g. one search widget for search gallery name only, another search widget for search the blog title. Any way to achieve that? Thanks for helping.

Text widget doesn't save the content

I am trying to save data in the default text widget. But when I click save, all the data are not saving and the field becomes empty. It happens when I edit in title field or text field. As I new to WordPress, I don’t know the solution. I haven’t installed any cache plugins. I […]

Customize WordPress widget – Product Category

I want to add some custom bullets next to my categories in my Category Widget so I created a new widget and added in my new html and classes so I can change how it all looks. Unfortunately for some reason my widget is adding a link to one of my last categories all over […]

Post ID displayed instead of title

I added the “recent post” widget on my blog but instead of blog titles it displays some random numbers: Take a look here. I have given titles to these blog so I don’t understand where these numbers are coming from. Anyone has any idea?

WordPress Widget Not Saving Data

I’m creating a very simple widget with 3 inputs. but whenever I changed the details, it’s not getting saved. Below is my code. Please let me know if there any issue. Thanks. class Simple_Twitter_Widget extends WP_Widget { function __construct() { $params = [ ‘description’=> ‘Display latest tweets from your twitter account’, ‘name’=> ‘Simple Twiiter Widget’ […]

Do widget options need to be escaped widget()?

I was wondering if you really need to escape user submitted data (widget option fields) within the widget() and form() functions (from the widget class) ? I don’t see a reason to do this, if the data is already escaped in the update() function. Or am I missing something?

Changing widget options via the functions.php when there are no hooks

The problem: to change a widget’s options with a custom function in functions.php, when there are no useful hooks, and where there are multiple occurrences of the same widget (multiwidget). This would involve: Retrieving the options from “widget_some-widget” in the “wp_options” table. (The returned option containing a string of settings (in serialized form) repeated several […]

wp_editor is not rendering shortcode

I have created a dashboard widget and this widget will show content which i’ll add from an specific page. So, i created a option page and made a textarea field with wordpress editor. wp_editor(html_entity_decode(stripcslashes($widget_content)), ‘widget_wp_content’); But when i am calling this field value in widget area than its giving correct image as image not image […]

How to list all custom post types in a custom widget?

I tried the Following (whihc lists custom post types called Static Content): <?php add_action(“widgets_init”, array(‘Widget_name’, ‘register’)); class Widget_name { function control(){ $custom_posts = new WP_Query(); $custom_posts->query(‘post_type=page_content&page_sections=Lastest’); while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?> <div class=”block-7 border-top”> <h2><a href=”<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></a></h2> <a […]