All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

Create a modified Gallery Widget in WordPress

I want to create a Gallery Widget - similar to the lines of the one already present in WordPress. In fact, I copied the complete code of the Widget class in the theme. What I want to create is a ...
1
vote
1answer
123 views

How to add multiple custom widget areas

I'm looking to add multiple widget areas to a page in my theme as id like to have widgets within certain pages. I can add one using this code, I'm just struggling with a second. function ...
0
votes
0answers
20 views

Add fields to the top of widgets form

I have read this and create custom fields. But I want to add these custom fields to the top of all other fields. (before all other existing fields) How to do it?
2
votes
2answers
709 views

How do I display the “Archives” widget layout (sidebar) in Wordpress by 'year' then by 'months'?

I am using the default widget in my sidebar Archive which currently displays the archive this way: Mar 2018 Feb 2018 Jan 2018 However, I'd like it to display this way: 2018 March February January ...
0
votes
1answer
93 views

is_active_sidebar() problem

I'm trying to develop a wordpress theme with a hero slider, I use some 3rd party slider widget inserted to the hero widget area I've defined as sidebar-hero in my functions.php file. I'm using this ...
1
vote
0answers
198 views

“Add A Widget” button in the Customizer

I'm developing a theme and working on the Customizer at the moment. I've been able to add sections, panels and controls to change text, colours and images. One thing I've seen on other themes is an "...
0
votes
1answer
30 views

What is the best way to build home pages with a lot of sections for distributable themes [closed]

I want to develop high quality themes by taking in to account all the important things like usability, accessibility. I just want my theme to be "perfect". Here is my dilemma. So, what is best way ...
0
votes
1answer
370 views

Widget for specific category

Hello every i am new to wordpress. I want to make my own widget which have a category selection option on backed and able to display posts from selected category on front.
0
votes
1answer
55 views

How to embed or integrated a custom WordPress Widget into the theme?

I have my custom theme, and I would love to embed/integrate widget into it so that it show up in Available Widgets when I activate my theme. I did a lot of research, but I didn't find a great answer. ...
1
vote
2answers
116 views

Customizer: widget-synced triggers twice

I just noticed that widget-synced is triggered twice when you're trying to edit a widget, click on a text field, write something, triggers widget-synced once and after that, if you click anywhere else ...
0
votes
1answer
45 views

Display problems in admin dashboard when creating a new theme from scratch

EDIT 2: I have found the code it was within my stylesheet! I had a class called "wrap" :( phew! Thank you everyone EDIT: I removed my stylesheet and now everything is displaying properly but I still ...
3
votes
1answer
300 views

Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option

So, in an effort to move my new project forward, I'm looking for a way to register and de-register widget areas depending on which header file I load via ACF Pro in the Options page. A bit of info ...
1
vote
2answers
1k views

How to limit number of number of categories displayed by categories widget

I am testing my theme against WordPress theme unit test, which states that: Large number of categories/tags should not adversely impact layout. I was able to manage the number of tags but could ...
2
votes
2answers
148 views

How i can get widgets areas working in customizer?

I'm encountering a strange issue with WordPress. I'm building a theme and the theme customization is driven by Customizer. So, basically in functions.php I'm adding add_theme_support( 'widget-...
0
votes
3answers
236 views

How can I develop multiple widgets for a WordPress theme?

I'm developing a new theme for WP and I want to add different sorts of widgets and different classes, because I want these widgets to look different (for example footer widgets should have another ...
1
vote
2answers
101 views

Can I individually style items in the backend widget list?

UPDATE Refrased the question On the backend widget page widgets.php, there is a list of available widgets. Items in this list have the same classes and a dynamically generated ID, which changes if a ...
0
votes
1answer
70 views

Dynamic sidebar areas not working on the Theme Customizer

I am trying to create one sidebar area per page in a WordPress site. For example, if a WordPress installation has 2 pages: 'Home' and 'Blog', then there'll be two sidebar areas, 'Home sidebar area' ...
0
votes
1answer
40 views

Methods for development wordpress themes [closed]

Analyzing the code from WordPress themes, both free and paid for, and realized that there is no standard for the development of themes. Some themes use CPT for all other widgets, other Visual Composer ...
1
vote
0answers
186 views

$this->get_field_id() not working in customizer

$this->get_field_id() is working fine when widgets are already added to it but when I add widgets using customizer it returns wrong id something like #widget-i My Code: //Custom Widgets class ...
1
vote
2answers
1k views

List authors with posts in a category

I'm trying to create a custom widget to display contributing authors for the current category being viewed on a WordPress site. I have the following PHP code: <?php if (is_category()) { ?> // ...
3
votes
1answer
722 views

How to get the registered sidebar's name by its id?

Let's say I have this code in my "functions.php": function mytheme_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar Name', 'mytheme' ), 'id' ...
1
vote
1answer
72 views

Custom Widget options in theme

I want to reprogram my first sketch of our theatre club page in wordpress but until now I only have basic knowledge of creating wp pages. As I want the theme to be as customizable as possible I want ...
1
vote
1answer
109 views

How to edit widget code to add unique class name to each div?

Code from existing widget: $get_featured_pages = new WP_Query( array( 'posts_per_page' => -1, 'post_type' => array( 'page' ), 'post__in' ...
2
votes
1answer
567 views

Theme Customizer - Choose where widget area appears, to let users organise widgets

I am creating a theme, and I have a problem with Widgets and Widget Areas. I am using the Theme Customizer to let the user edit the content, colors, etc. I know how to create a widget area. I need to ...
0
votes
0answers
65 views

Create new sidebars trough admin post/page metabox

I have this bit to register sidebars dynamically: function my_custom_sidebars() { $sidebars = get_option('my_theme_sidebars'); // get all the sidebars names if ( ! empty($sidebars) ) { // add a ...
0
votes
2answers
1k views

Add the title of a widget as an ID - for anchor links

I'm currently building a WordPress theme where my page consists of widgets. One widget is a part of the page. I'd like to be able to use anchor links with them, and to do this, I would like to output ...
3
votes
1answer
85 views

Adding widgets programatically: how to avoid collisions?

I am developing a theme, and I'm trying to add widgets programatically to its sidebar. I read this excellent answer: https://wordpress.stackexchange.com/a/51086/14225 But there's one thing I'm not ...
2
votes
1answer
780 views

Adding inline styles from a widget

I'm working on a theme that has an optional widget to allow users to put some site elements where they want. One of those is a list of social media icons. These are font icons, so they can be styled ...
0
votes
1answer
55 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 ...
3
votes
1answer
521 views

use add_action('wp_head') in a widget for generating dynamic CSS styles

I have been working on a 'Custom Pop Links' widget for use in a theme which is ready for distribution. User can change the color of a link using a color picker inside widget. Untill now, I used inline ...
2
votes
2answers
133 views

Displaying Widgets

During theme development, I understand how to create basic widgets within the functions.php file. However, when it comes to displaying the widget within a theme, is there a preferred way to display ...
1
vote
1answer
133 views

Can I have a widget and sidebars in custom theme?

Wordpress 4.1.1: simular problem to another question: I have a add_action widgets_init call back in which I have a call to register_widget that registers a class and a call to register_sidebar that ...
0
votes
0answers
29 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 - ...
0
votes
1answer
308 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
2answers
500 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') || !dynamic_sidebar(...
1
vote
1answer
97 views

Displaying details of a post in a sidebar

I am developing a wordpress theme but m still new into and was learning. Basically, its a theme for resource website which provides web templates. In my theme i've created a details section in sidebar ...
0
votes
1answer
70 views

Wordpress Footer Widget Processing

I made a sidebar in wordpress and have widgets in it, I want to process them one by one so that I can set their locations in theme according to me. Example: If I have a 3 widget in my footer ...
0
votes
0answers
1k views

Custom widget not appearing on front end

I have the following widget location defined in my theme's functions.php: register_sidebar( array( 'name' => __( 'Opening Hours', 'transparent' ), 'id' => 'sidebar-hours', '...
0
votes
4answers
1k views

Allow different <span> tags in widget titles

How can I make widget titles allow HTML? I want to add icons from an iconfont to the titles like <span class="icon-someicon">Widget Title Here</span> I tried the following but it does ...
0
votes
0answers
28 views

What's the policy for building a theme that doesn't support widgets/menus?

I'm developing a minimalistic theme, and my plan is not to include menus or widgets in it. The Theme Review page on wordpress.org states: Whether implementing required, recommended, or optional ...
1
vote
1answer
1k views

How to add a text widget during theme activation

I'm trying to add a text widget with the title and text set, to two custom sidebars in my custom theme. But, I can't find a clear walkthrough of how to do it. I've seen bits of code here and there, ...
0
votes
1answer
52 views

Creating a Playlist of Widgets

I'm trying to create a specialized theme that would enable users to show a playlist of widgets in their sidebar. By playlist, I mean that each widget in the sidebar would follow a specific schedule. ...
0
votes
1answer
258 views

How to display only some widgets of a sidebar?

I would like to break up a sidebar over three containers. Each container should hold up to three widgets of the sidebar. Therefore, I need to find the HTML for only the widgets 0 to 2, 3 to 5 and 6 to ...
2
votes
1answer
7k 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
36 views

How can I specify that an area of my theme contains widgets?

I am pretty new in WordPress theme development and I am developing a theme that use BootStra CSS framework I have to do that a specific area of my theme can contains some widget\module (I don't know ...
2
votes
3answers
4k views

Adding WordPress colorpicker in widget settings

I want to add the WordPress default colorpicker in widget settings form. Here's what I'm trying: In my functions.php, I have this: function widgets_scripts( $hook ) { if ( 'widgets.php' != $hook ...
0
votes
1answer
65 views

How to include a file only on dashboard widgets page?

I want to add some styles to the widgets input fields. Therefore I want to include a style.css file only on the wp-admin/widgets.php page. How can I detect the above page and include file there?
0
votes
2answers
43 views

Is it acceptable for a WordPress theme to not accept widgets?

I'm developing my own WordPress theme, and I was going through the Theme Unit Test as described by the Wordpress Codex. Now, at some point, the Codex mentions that I should verify that All widgets ...
0
votes
0answers
24 views

grouping my widgets wordpress

In the widgets page, there are two boxes "Available Widgets" and "Inactive Widgets". How can I add a new boxe with my custom name where I can group all my widgets.
1
vote
1answer
822 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( 'sidebars_widgets'...