Widgets are configurable elements used to dynamically build sections of a WordPress theme.

learn more… | top users | synonyms (2)

1
vote
3answers
3k views

Is It Possible to Restore Accidentally Deleted Widgets?

I accidentally deleted the widgets without dragging it to the inactive widgets section. I have a backup of all the files and the database but i have changed many things on the site other than the ...
0
votes
0answers
17 views

twitter widget loads properly in all themes except my own theme?

I've written my own theme for my wordpress website. The problem is that the twitter widget loads properly in all the themes except mine. Below is the attachment of the widget in both the themes - ...
8
votes
3answers
171 views

Plugin upgrading: Widget settings

I have tried doing some research on this but haven't found anything solid yet. I have a plugin I am working on and between the last version and the new version we made some updates to the widget that ...
0
votes
1answer
89 views

WP_Widget dynamic field array with external AJAX

Im creating Wordpress widget, where I have to add parts of code dynamically by JQUERY.ajax() a JQUERY.append() to the widget form. I need it, to be able to save it by function update(). I have PHP ...
0
votes
1answer
22 views

Detect each active instance of a widget

Is it possible to detect each active instance of a particular widget? As part of a plugin I'm working on, I want to run a for each loop on each widget instance Each widget is a Twitter feed and the ...
0
votes
4answers
906 views

Widgets not displaying in theme customizer

I am developing a new theme and I am using several sidebars in this theme. All works fine, but the widgets are not showing up in the theme customizer section. All widgets are working fine under ...
0
votes
2answers
513 views

Unregister widget from Child-Theme

I like to use a child-theme. The parent functions.php function starkers_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Primary Widget ...
0
votes
0answers
34 views

Unique widget id to target specific part of widget

I am currently trying to target widget part after title and collapse it on smaller screen where title would be a toggle. This is in my footer area and there are 3-4 widgets that I want to collapse on ...
0
votes
1answer
86 views

wp_nav_walker that interacts with widgets to setup mega menu

I'm a newbie WordPress developer working on a WordPress theme project that demands mega menus as part of the main navigation. I'm done with the front-end stuff, and now I'm trying to explore the ...
0
votes
0answers
23 views

Widget configuration inside theme

I need to change my theme on the fly (for mobile version I have a different appearance), but widgets are not saving correctly. I tried to configure widgets from the theme, but this method doesn't ...
7
votes
1answer
12k views

Translate widget titles using qTranslate plugin

I'm actually using the qTranslate plugin to translate my website. It works really well with everything except one thing. the titles of my sidebar widgets. Actually, to translate some words we need to ...
0
votes
2answers
90 views

how to display custom widget anywhere in wordpress

i've a custom widget for ads,it helps me to show ads on sidebar but i'm trying to display it under every single post or on front page near to slider. <?php the_widget( 'AdWidget_300' ); ?> ...
25
votes
2answers
7k views

Between functions.php, widgets and plugins, which is loaded first?

Customer asks if a specific carousel plugin he uses can be widgetized. That means i should create a widget inside functions.php which calls the plugin's function. That means that the plugin's code has ...
0
votes
0answers
28 views

Custom widget not saving values

Hello I am very new to Wordpress development , I am trying to implement custom widgets for a theme. the problem is whenever I try to save my widgets settings it will automatically revert back to it's ...
0
votes
1answer
52 views

Custom post types archive

I'm developing my first custom theme from scratch (using Roots as base framework). The theme has 2 CPT, one for events and one for associations with a correlation one to many between the two (an ...
1
vote
1answer
30 views

Creating a one click demo importer

edit: I've re-written this because it is unclear, apologies it was written rushed on a Friday afternoon. Wordpress has import/export functionality for posts within wordpress, I am a theme developer ...
0
votes
1answer
85 views

php- What can be the best alternative to eval()?

I am using WordPress and for some reasons I need to execute php in my WordPress text widgets. I googled and found this code to add in functions.php file: add_filter('widget_text', 'php_text', 99); ...
0
votes
1answer
22 views

How to remove a widget from the sidebar on specific page?

I want to remove a widget from page with id '28'. How can I do it? I have found function for it, but it is private function, so I can't use it. "wp set sidebars widgets This function's access is ...
36
votes
5answers
7k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
0
votes
1answer
64 views

Change Widget that display posts from categories to tags

I have a theme with a widget that display posts from category and I wanna change it to posts from tags if it s possible. Here is the code : // NewsInPictures Widget class NewsInPictures extends ...
-1
votes
1answer
22 views

How to hide sidebar widgets in all pages except Hompage?

im using a sidebar widget in homepage for an extra gallery. sadly it appears in every pages ._. thanks in advance
0
votes
0answers
45 views

Add text editor to custom widget

I am aware of a few plugins that simply add a rich text widget, but I want to make a widget that will wrap the whole input in a class to be used in the page editor plugin. I just want to add a ...
2
votes
1answer
834 views

Custom shortcode in widget forced to top of widget

A custom shortcode i made is being forced to the top of the widget outside of the widget container. Any ideas why? This is my code... function nktmediaplayer_func($atts) { ...
0
votes
2answers
42 views

How to create another widgets.php page

Is it possible to create another widgets.php page? say widgets-ads.php? I want to make it for displaying ads in my website by drag and drop of widgets in a predefined sidebars.
0
votes
1answer
107 views

Widgets Section not displaying in theme customizer

When in the WP Theme Customizer, my widget management section isn't displaying (i.e. I can't add/change/remove widgets). I CAN, however, add widgets from the Appearance -> Widgets section, just not in ...
0
votes
0answers
27 views

My widget it showing up only its title, not content after adding the widget without saving

I made a simple Recent Posts widget that not showing up its content if I don't click the save changes after adding the widget. I notice this similar issue on some WordPress core widgets too. What can ...
0
votes
0answers
64 views

How To Make Wp Dynamic Sidebar Like twentytwelve Theme

im new in wordpress and trying to create wordpess theme which can be used in any wordpress blog ,im following twentytwelve Theme as my theme example but when i try to create sidebar it does not work ...
2
votes
1answer
33 views

how can i limit the number of instances for my widget

I am developing a generic widget that randomly selects an image to be displayed. I only have 5 images to choose from. Is there any way to limit the number of widgets to 5, so that there are no repeat ...
0
votes
1answer
38 views

How to detect if query is runned from widget?

I want to know if exists function that detect if some database query run from widget, for example from recent_posts widget or search_widget.
0
votes
1answer
19 views

Expanding a function to call a plugin or show a link

I have added the following code to my functions.php to validate if a user is logged in before allowing them to fill out a form: function my_members_only_shortcode($atts, $content = null) { if ...
0
votes
1answer
32 views

How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?

Lets say i want to detect such thing from the "functions.php" .. to know which Sidebar (or) which Menu is being loaded on current (whatever landed) page, how can i know? Lets say i have a few pages, ...
0
votes
1answer
35 views

Why isn't this widget displaying one of the icons?

I have coded a widget. In the admin area the user can enter the url for their youtube, facebook, twitter and google+. On the front end of the site in the browser, they can click on a logo for either ...
0
votes
0answers
106 views

Creating custom search results widget

I am new to wordpress and trying to accomplish the following: I want to create a wordpress widget with the following functionality. Please advice how it can be accomplished: Widget should accept ...
0
votes
0answers
12 views

Converting hashtags into search friendly term (%23) in a widget

The plugin Hashtag can achieve this within a posts text, so surely its possible on a widget? I have no idea what I'm doing here, specifically its the widget 'Popular searches tag cloud' I am trying ...
0
votes
1answer
99 views

Proper approach to moving complete site from one domain to another AND preserve widgets

I consider myself fairly versed in this matter, however I've recently had a rash of issues when moving sites. I am able to successfully move the site, edit wp-config.php, move the database, etc. ...
0
votes
0answers
24 views

Enhance built-in calendar widget to dynamically browse through months

I am using the built-in calendar widget to show posts, the plugin "Future" helps me to show future posts too and so far everything works fine. But when you click on the arrows for the previous or ...
1
vote
0answers
92 views

How to create pagination for homepage with widgetized area?

I have created homepage with sidebar area filled with different widgets. Each widget fetch and display posts from different categories. Now I need to create a numbered pagination in homepage which ...
0
votes
1answer
81 views

Extending the WP_Widget_Text class

I am trying to alter the output of the default WordPress text widget. Since the widget is written in OOP I hoped it could be a simple deal of extending the class and overwriting one method – but it ...
0
votes
2answers
106 views

Widgets won't save

I have almost no experience in creating widget area's and I am stuck at saving the widgets in the widget area 'red menu'. I have searched a dozen posts but I can't seem to get it working. I am ...
2
votes
1answer
147 views

How to enable “shift-click to edit this widget” functionality on a custom widget?

I have created several custom widgets, modeled from the default widgets' code. The widgets all work fine, and I've been using them in production for awhile. I've been working with the new Customizer ...
0
votes
0answers
22 views

Wordpress Custom Widget Strange Behaviour

I have developed a Custom widget plugin with a dozen of input fields. Some of those input fields load Fabtastic Color Picker. When I add the widget in any widget area, the color picker loads very ...
0
votes
1answer
191 views

Custom widget doesn't save values from dropdown box

I am trying to save the value from a dropdown box on a custom widget created by me. the title from the same widget is getting saved, but not the values from drop down box. Can someone please help me? ...
0
votes
0answers
10 views

Sidebar Categories Questio

I added five categories through widgets on my primary sidebar. Under each of them, all of my main categories that have posts in them are coming up. However, I only want certain categories to come up ...
0
votes
0answers
8 views

Widget is breaking on filter function

I have created a widget which displays posts based on Display Posts shortcode. All works fine till I have added filter to public function widget() to output titles only (and need to be executed only ...
1
vote
1answer
154 views

instance is empty in function widget()

I am working on a widget for my theme. If I do a print_r($insance) in the form function, the instance array is populated with the correct data. I have checked the database and the correct ...
0
votes
2answers
86 views

Show different website layout if no sidebar added

I have a question about website layout with and without wp widges in sidebar. Here is the code i have for my registered sidebar. <?php if ( !function_exists('dynamic_sidebar') || ...
0
votes
1answer
62 views

How to Sync Menu, Widgets and other masters from Main Website to its Sub Site

I am using Wordpress Multisite Network and i am having problems regarding masters to its subsite. I am not able to see the widgets or Menus which were created on Main website to its Sub-site. When i ...
0
votes
1answer
40 views

Hide first blog post in content and output it in widget

I am working on a theme and want to hide the first blog post and instead output it at a custom widget position. For that I created a variable in the functions.php called $postCounter. I accessed ...
0
votes
1answer
23 views

Target logic based on Widget / Sidebar Name

I have a theme that uses registers a sidebar called 'homepage-middle-widget' and it's child widgets are pulling images in undesired sizes. Is it possible to target a widget and / or it's parent in ...
0
votes
3answers
77 views

How to add css classes to widgets?

I need to add a class to the WordPress search widget. How would I go about doing so? I'm calling it from the admin side, as in dragging and dropping it into the sidebar at the widgets page of the ...