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

learn more… | top users | synonyms (2)

0
votes
1answer
131 views

Change Woocommerce Product Categories Widget 'Title' based on Product Category

I'm looking for a way to change the widget title of Woocommerce Product Categories Widget based on the category I'm viewing. Category 1 -----> Display Title of Widget for Category 1 - Sub ...
0
votes
1answer
55 views

Non-static method error when trying to use class in widgets

I'm trying to call a method into a function widget. The $this of the widget is passed to that method, but I get the following error: Strict Standards: Non-static method class_name::method_name() ...
0
votes
1answer
73 views

Check if the current shortcode is being used in a widget

How can I check if the current shortcode is being used in a widget? I need to disable some shortcode options that are not allowed in a widget. Someone know how?
0
votes
1answer
50 views

Widget to embed youtube video

I am new to WordPress development. Currently I am trying to make an widget to embed video from youtube. My plan is an admin or an author will just give the video id and the video will be in widget ...
0
votes
1answer
24 views

Adding link on title its in description but not in title see screenshots attached

This should be simple fix. I am learning php so am not that good to spot the obvious. Here's the website http://goo.gl/tE4OSO. here's what I want http://imgur.com/qZXPPYu . Here the code I believe ...
0
votes
1answer
22 views

Make a widget to my footer

I am using a theme and the developer doesnt want to help me make a widget on the templates/footer.php The curently code at this php file is <div class="bw-footer <?php echo isset( $class ) ? $...
0
votes
1answer
32 views

Are WordPress widgets cached?

I'm not sure if it is true but seems that the content of the widgets is cached. I initially thought there was a problem with my code (I need to hide/show a section in a custom widget according to a ...
0
votes
1answer
37 views

Create a setting at backend,to print only selected categries at front-end

I am making a plugins widget .In back-end when i am clicking on the selected categories that categories only shows in frontend. I just making code checked categories but after that what to do,i don't ...
0
votes
1answer
21 views

widget: input the px value from user and use it as inline style in widget function

I am trying to dynamically add margin-bottom property to my widget. For example, I am inputting the value "50px" from my widget and want to use this value to adjust margin-bottom property for the ...
0
votes
1answer
41 views

How to add a toggle on the left side of my page?

How to add a toggle on the left side of my page and the content on the right side of my wordpress page. The toggle should behave like a menu on the left side(the arrangement)and each heading would ...
0
votes
1answer
18 views

Slider from different widgets

I need some advice. I have added the possibility to pages to have categories with a plugin. I have created a widget for a client that lets a user select a category from a page and select a subpage ...
0
votes
1answer
26 views

Does current page contain widget or sidebar

Is there a way to detect whether a specific page contains a widget or sidebar. I am aware of is_active_sidebar() & is_active_widget() which return true or sidebar containing the widget, but this ...
0
votes
1answer
33 views

Organizing the position of widgetized areas in the backend

Is there a way to position the widget areas in the WP admin -> Appearance -> Widgets page? I've arranged my register_sidebars function in the proper order however they seem to be displayed randomly. $...
0
votes
1answer
85 views

Widget without DIV wrapper

Whenever I add a text widget it adds a div around the content I add. E.g. <div class="textwidget"> <my content> </div> which messes up the formatting of some of my content. Is ...
0
votes
1answer
45 views

Nonce and widget

I've been screening the code of several widget and haven't found any one of them handling nonce. I also took a look at the WP_Widget class and found nothing about it as well. This is from the codex: (...
0
votes
1answer
376 views

display custom post type in widget aera

I am using https://wordpress.org/plugins/custom-post-type-ui/ plugin for custom post types. Now I need to display contact information in my footer area, email, phone num , address etc. For this I have ...
0
votes
1answer
128 views

How to add image uploader to a custom widget?

I'v built a custom widget that will show some sport scores. Scores are added trough custom post. When i open new custom post(scores) i enter their team names, score, scores. Now i want to add an ...
0
votes
1answer
74 views

Even with PHP plugin get_posts not working in widget area

I have the following code in a template, it and displays images form a custom field: <ul class="about-us-grid"> <li> <?php $posts = get_posts('post_type=employee&orderby=rand&...
0
votes
1answer
68 views

Update title of every instance of widget using text field

I have created a simple widget which looks like this: As there are going to be many instances of this I want to know if it's possible to update the title of each instance (where it says 'Membership ...
0
votes
1answer
55 views

Widgets Opening In New Window - Unwanted

I am dumbfounded as to why my sidebar image widgets are opening links in a new window when I do not have the "open link in new window/tab" checked off. The box is blank. My page is www....
0
votes
1answer
303 views

How to Register and Display Widget for Custom taxonomy

I have registered a Custom Taxonomy Named as Album, Now i want to register and display a custom widget like category to display recent 'x' albums with thumbnail on my sidebar. Below is a piece of ...
0
votes
1answer
237 views

using get_template_part() inside a widget and passing variables

I read that get_template_part() should only used by themes not plugins, I don't know if using it inside a widget function (created by the theme) is considered as a plugin or not. Anyway, I'm trying ...
0
votes
1answer
31 views

How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?

I have theme options/settings page and options/settings fields set as outlined here: http://code.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-2-sections-fields-and-...
0
votes
1answer
47 views

include exception inside theme for empty widget area

Im using Storefront-paper theme for a blog, and for my sorprise, sidebar.php include a code to block possibility to have empty widget area. In this case I would like to use a page how front page, ...
0
votes
1answer
29 views

How to make featured area?

I'm trying to make custom wp theme, but i have one thing that i don't know how to make. I would like to make featured area on my page like this for example: http://prntscr.com/7gespg I made widget ...
0
votes
1answer
38 views

Checking if widget has title not working

Here's my function which is not working: function ts_dynamic_sidebar_params($params) { global $wp_registered_widgets; $settings_getter = $wp_registered_widgets[ $params[0]['widget_id'] ]['...
0
votes
1answer
74 views

How to place a widget beside a div/text so that they display as a continuous line

An example will probably provide the best base context. I want to achieve: Headline widget (linked text/image)... linked text Point of difficulty: displaying these so that they read as one line, ...
0
votes
1answer
49 views

Best strategy for providing theme options using customizer

I am making a free distributable theme and I wish I could provide theme options in the best possible way. I have doubts (mostly about widgets) and sidebars. Here we go: Is it a good idea letting the ...
0
votes
1answer
42 views

Wordpress version quick check?

This should be a FAQ but I didn't find it quickly. Logging into my wordpress site as admin on the upper left and lower right it reminds me to upgrade to 4.2.1. This support topic on wordpress.org says ...
0
votes
1answer
45 views

How to get data from one wordpress site to another

I have the following sites: 1. Community News site 2. Classifieds site 3. Coupon Site Is there any way I can get data from my classifieds and coupon site on my community news site....like in the ...
0
votes
1answer
53 views

Widget Script Loads at Bottom of Page

I've been working on a plugin that adds a script to the sidebar when activated. So far, I've been able to display the code, but it loads at the bottom of the page and not in the sidebar. I'm pretty ...
0
votes
1answer
91 views

widgets not working

I pasted my siderbar widget code in widgets.php file function right_sidebar_widget() { register_sidebar( array( 'name' => 'Right Siderbar', 'id' => 'right-siderbar', ...
0
votes
1answer
44 views

Cannot access variables within a widget

I'm currently learning PHP and Wordpress development from a Java background at the moment. How do I access variables in public function Example_Widget() from public function widget( $args, $instance )?...
0
votes
1answer
109 views

Editor Widget Role

i need to give to editor role the access on widget (or if possibile on a specific widget). I use the code on this question and function but i have a problem. The editor can see the widget and also ...
0
votes
1answer
44 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
1answer
63 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 ...
0
votes
1answer
57 views

wp_query in form method of widget breaks customizer

In the "form" method of one of my widgets I make a query to offer the user some posts to choose from, like this: <?php $products = new WP_Query( array( 'post_type' => '...
0
votes
1answer
32 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
37 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
194 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
46 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 PHP?...
0
votes
1answer
54 views

Widget Logic code for different PMP membership levels

I'm using both Paid Memberships Pro and Widget Logic plugins. In PMP, I set up 2 membership levels - one free ( id# = 3) , one paid (id# = 1) With Widget Logic, I'd like to have the custom sidebar ...
0
votes
1answer
351 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
94 views

Wordpress Javascript Widget jQuery Dependency Issue

I am using a local clean install of WP 4.0 en_GB with no plugins. I have been provided with some information to implement a JS widget into my website. <div id="login"></div> <script ...
0
votes
1answer
21 views

Get widget locations in WordPress plugin

I'm writing a plugin and i am searching for a function (preferably a WP function) that returns all sidebar id's that have my widget in them. For example : i placed my widget in sidebar1 and sidebar2, ...
0
votes
1answer
146 views

multiple custom post type category selection search

I hope it's clear from the title but let me try to explain it better. Looking at this image should make it clear: I have custom post type names Product and categories related to it. What I am ...
0
votes
1answer
13 views

How to Make widget area on place of comment

I want to make a widget First I registered widget area in functions.php register_widget(array( 'name' => 'widget', 'description' => 'Sidebar below single post', 'before_widget' =>...
0
votes
1answer
179 views

I'd like to move the Widgets Panel to the bottom of the list in Customizer

I'd prefer to have the 'new' Widgets Section/Panel (that extends to the widget areas) drop down to the bottom of list in Customizer. I've tried: $wp_customize->get_panel('widgets')->priority = ...
0
votes
1answer
106 views

Widget & storing a Select box choice

I am creating a simple widget which displays all of the pages on the website. The trouble I am having is how to store the user's choice and display it on the front end. At the moment, when saving my ...
0
votes
1answer
224 views

Display Posts by Views (Popular Posts Widget)

I am trying to display the most popular posts based off of this, but I don't think it is working properly. When you view a post it seems to add 1 view to each of them, not just the unique ID. <?...