Articles of widgets

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 […]

Dividing widgets in sidebar?

I’m having a custom sidebar called Footer. I’m displaying this sidebar using this code: <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘Footer’) ) : ?> (maybe I should do something in this line?) 🙂 <?php endif; ?> This works smoothly, but almost every theme nowadays allow users to place their widgets in columns, just like there: […]

How put links in wordpress dynamic sidebar?

i would like put link after each widget in dynamic sidebar. I thinks is possible if i use static sidebar, but i don’t found any tutorial for this. Thanks you

Adding a rich text editor to a widget – specifically CKEditor

I am trying to add a rich text editor to a widget and am using CKEditor ( ) with a simple toolbar. Everything works fine until I try to save. When clicking on “save” the textarea (and texteditor) vanish and it fails to save. Removing the texteditor allows the textarea to work and save […]

How to embed form data within the 'Add new post'

I want users to be able to use a car template in new posts. The template will include items such as a photograph of a car, make, model, number of doors, colour of car, etc. Users will not want to use the template in every one of their posts. How should I do this? My […]