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

learn more… | top users | synonyms (1)

0
votes
1answer
43 views

Correct code to use php in text widget

This code is used to display php inside a text widget add_filter('widget_text','execute_php',100); function execute_php($html){ if(strpos($html,"<"."?php")!==false){ ...
0
votes
1answer
16 views

What's the right way to share data between widgets?

I've got a few custom widgets in my site, which I'm targeting to specific tags. There may be a case where there may be an overlap in widget targeting, and the desirable behaviour may be to only show ...
0
votes
2answers
120 views

Post-specific widgets in Wordpress 'Twenty Fourteen' theme

Using Wordpress 3.8.1 with 'Twenty Fourteen' theme I'd like to arrange my post in such a way that it's main contents go to main (center) column while galleries, attached files and links pertaining to ...
0
votes
2answers
13 views

Add links widget to self-hosted blog?

http://en.support.wordpress.com/widgets/links-widget/ discusses a Links widget that makes it easy to create a blogroll in your sidebar. I'm not seeing this widget in my blog by default, and searching ...
0
votes
1answer
39 views

Why would apply_filters return a non-empty string, when the value returned is empty?

Been breaking my keyboard over this. Did a proper install, uploaded the database to a fresh MySQL and been working on using child themes properly. But there is something plaguing me I can not figure ...
0
votes
1answer
37 views

Widgets not showing in my custom theme

I am developing this WordPress custom theme: http://onofri.org/WP_BootStrap and I am trying to insert a widget area under the Partner e Sostenitori section, but can't work. I have performed the ...
0
votes
1answer
13 views

Widget only in first post

I want to put a widget area into the content of the first post. My problem though is that is can't figure out how to get only the first post in my function. Here is my function: function ...
0
votes
2answers
29 views

Using filter in the widget causes fatal error

I'm adding a filter for a WordPress query in a widget. I'm adding as following: function filter_where( $where = '' ) { } add_filter( 'posts_where', 'filter_where' ); $query = new WP_Query( $args ); ...
0
votes
1answer
51 views

Dashboard Widgets - Add Admin Page With Same Functionality

I have a plugin that has its own dashboard with basically quick-views of relevant data and I wanted to know if there was an "easy" way to mimic the functionality of the admin dashboard where you can ...
0
votes
1answer
31 views

What conditional to use for dynamic sidebar check?

I have looked here on WA and also on the codex but there is no definitive source that I could find. Which is the proper/best way to check to see if a dynamic_sidebar is active and contains a widget? ...
0
votes
1answer
30 views

Customizing the Widget content markup

I am using bootstrap to create panels for the sidebar widgets, and I can set the container markup for the widget, as well as the markup for the panel header, but I cannot provide the markup for the ...
0
votes
1answer
47 views

Best way to add internal link in widget

I'm looking for a way to transform a static piece of code into a widget to display in different sidebars containing a simple internal link. The basic code is: <div class="my-link-box"> <a ...
0
votes
1answer
129 views

How to avoid the <div> and <ul> which added when custon menu widget is used

I need to remove the custom menu widget <div class="menu-main-container"> <ul id="main" class="menu"> from appearing above the <li>. Because of this two lines my menus are not ...
0
votes
1answer
40 views

Widget : html 2 dimensional array doesn't work

I have some strange trouble with my WordPress today : I want to store same multiple values in a widget, so I create something like this : myCollection[id][myField] as input's name for my admin widget ...
0
votes
1answer
37 views

call widget from within shortcode

I have a shortcode in my functions.php which runs a query on a category. I want to have a twitter feed on this particular page. I have a javscript option working on my page for twitter right now but ...
0
votes
1answer
498 views

How to add Wrapper Div/container element around Wordpress Widget Content

I want to apply style to widget content of Wordpress but I see widget Content area is not having uniform class. TextWidget are having class "textwidget" and that is uniform but other widgets are ...
0
votes
1answer
83 views

display most popular tags in two columns

I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however ...
0
votes
1answer
102 views

Add custom data (field) to sidebar widgets for later display

I am building a theme that allows widgets to be dragged & dropped, essentially turning WP into a desktop-like environment where the admin controls what "apps" are available via the widget panel. ...
0
votes
1answer
147 views

Widget select option not saving

I do this widget but the selected options dont saving when updated. This is the code: /* CUSTOM POSTS LIST */ class Posts_list extends WP_Widget { function Posts_list() { /* Widget ...
0
votes
1answer
287 views

is_active_sidebar() Always Returns False

I've never gotten is_active_sidebar() to work, no matter if there's widgets in the sidebar or not I always get false returned. Currently I'm creating a sidebar for each top level page: ...
0
votes
1answer
79 views

Can't work out why widget contents disappear from admin

everytime I make a change to any widgets in admin they disappear - sometime just from admin, sometimes from the frontend and sometimes both. I get them back by adding update_option( ...
0
votes
1answer
134 views

Widget title markup in register_sidebar

How come the markup I specify in the 'before_title' and 'after_title' settings of register_sidebar gets applied to the default text WordPress widget but not one of our custom widgets, when both are in ...
0
votes
2answers
121 views

How to hide widget from certain category

I need some way to hide theme built in widget from one category.So when the post is from category X on that post hide that widget. I would use plugin for it, but since it's not drag and drop widget I ...
0
votes
1answer
70 views

How to get class from widget area

So... I registered my widget areas with this code: register_sidebar( array( 'name' => __( 'Posts Widget Area', 'ikos' ), 'id' => 'primary-widget-area', 'class' => ...
0
votes
1answer
45 views

My widget won't update its values when save is clicked

So this is my first attempt a creating a widget that has a functionality of creating a simple image rollover effect (if anyone wants it when it's done, leave me a message). Now I downloaded a sample ...
0
votes
1answer
13 views

When adding a widget, what kind of widget should I used to add images and text and styling?

Is there such a thing? I would settle for images, text and maybe headers. I know I can add HTML into the text widget. So is that what I should be doing? But how do I add images to the site? That ...
0
votes
1answer
126 views

Conditional widget_form_callback

I have attempted to develop a way to set something in a widget only if the widget exists in a specific sidebar. The code below looks for sidebar called 'footer' and shows the select option above the ...
0
votes
2answers
254 views

Remove/Hide a Widget on a Custom Template

i want to make a custom template using Genesis.. I added a custom Menu just by adding a widget on WIDGETS section and placed it on the top right side of the page. But i want it to be removed in a ...
0
votes
1answer
82 views

Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin - Adding to “Thoughts” Theme

How do I enable infinite scroll (either with the infinite-scroll plugin OR the built in infinite scroll jetpack) on the "Thoughts" Wordpress theme? I'm a total noob at editing this stuff so if you ...
0
votes
1answer
38 views

How to display a widget on a page with no theme?

I would like only a widget to appear on a page, is this possible? As in if I created a page, I am wondering if I can make a page just display the widgets contents with no headers, sidebars, just ...
0
votes
1answer
46 views

Wordpress dynamic widget by location?

i need to show the widget based on user location , for a testing purpose i have created the by using following code if( function_exists( 'register_sidebar' ) ) register_sidebar( array( ...
0
votes
1answer
316 views

How to hide custom sidebar on mobile

So I have made some customizations to my wordpress premium theme,but I want to hide those customizations on mobile versions. I've tried to add id of widget inside @media with display:none; but ...
0
votes
1answer
347 views

Sidebar widgets - dynamic CSS : problem with widget-title

Fortunately or unfortunately without much studying I made a dynamic sidebar widget area for my client's website. My functions.php codes are: ... register_sidebar( array ( 'name' => 'Left ...
0
votes
1answer
71 views

How to conditionally add a widget via a hook in functions.php

I'm trying to add some widget areas to the homepage only using functions.php - so that the client won't be able to accidentally destroy shortcode when editing the page. I've registered the widget ...
0
votes
1answer
240 views

Widgets menu does not appear under “Appearance” in dashboard

I am developing a WordPress theme, but am stuck on widgetizing my theme. I have followed several tutorials but still cannot get it to work. My widgets menu does not appear under Appearance in my ...
0
votes
1answer
250 views

Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?

Ok so here's the question how do i stop js from running twice on the widget.php page? I am creating a ajax loaded custom image selector from a domain on the same server as the current site. I want ...
0
votes
1answer
244 views

Wordpress: Apply filter/hook to a particular sidebar widgets?

I'm developing a theme that has more than 5 different sidebars and I want to apply a function to a particular one of them for styling purposes. Basically, the function will modify it's params using a ...
0
votes
1answer
164 views

Adding a single text input field to a custom Dashboard widget

I have a client whom I want to give as much Dashboard control over the admin area as possible. I know how to create a custom dashboard widget that contains just text/html but I have no idea how to ...
0
votes
1answer
36 views

widget not displayed

the command echo '<pre>';print_r(wp_get_sidebars_widgets()) ; returns [sidebar-page] => Array ( [0] => execphp-5 [1] => simple-section-nav-3 ...
0
votes
1answer
97 views

Dynamically creating multiple widgets from Mustache templates

I built a bunch of basic Mustache templates for a project, and now I'm wanting to effectively make them available to WordPress as widgets. //This uses Composer to manage dependencies (Mustache). ...
0
votes
1answer
118 views

Simple form to add custom links to menu?

I currently have a menu set up called "sidebar links" with 5 custom URLs. In my widgets section I have a Custom Menu which shows my "sidebar links" menu. This basically gives my sidebar 5 links. ...
0
votes
2answers
92 views

Unable to add widgets to sidebars in custom theme

I'm trying to add a footer area to wordpress so I can drop widgets and things there. I see my footer area in the admin section, but if I add a text (or any other) widget and then save it, nothing ...
0
votes
1answer
210 views

how to show only particular category post in archive widgets

i want to display blog category month list in archive widgets. but i i can't figure out yet how. i have more category like review, gallery etc. normally show all month list in archive widgets but i ...
0
votes
1answer
27 views

Link a widget or find the php that creates the widgets

I would like to make the entire widget a link. Ideally, I would like to find the php file that has created the widget and then modify that. Q: Is there a way to backtrace the HTML to find what php ...
0
votes
1answer
39 views

Override widget in function WordPress

Im trying to override the text widget in WordPress. My code looks like this: class WP_Widget_Text_Custom extends WP_Widget { function __construct() { $widget_ops = array('classname' ...
0
votes
2answers
67 views

random reason on refresh

I am editing the sidebar widgets and have added one for users who are not logged in or registered. the widget requests that users register or login and I am wanting to add a random reason (quote) as ...
0
votes
1answer
52 views

How to change widget's form color in admin?

I have a simple question. How to change widget's form color in admin panel of wordpress (on widgets page) to make them more unique? Here is a simple example:
0
votes
1answer
75 views

how to extend a WP_widget twice

Has someone ever tried to extend calss WP_Widget, then extend it again ? Having to related widgets, I tried to create the first extending WP_Widget, : class FirstWidget extends WP_Widget { public ...
0
votes
2answers
98 views

Is there a way to allow only certain type of widgets in the sidebars?

For example, I want Sidebar A to display nothing but one text widget and Sidebar B to display anything but text widgets. How can I do that? Thanks.
0
votes
2answers
249 views

register child class in another plugin

I think this should be relatively easy, but somehow I cannot figure out how to do this. essentially there's a preexisting plugin that does this: add_action('widgets_init', create_function('', ...