Articles of widgets

How to get sidebar widgets in leftsidebar template

I have created a custom sidebar widgets using below code : register_sidebar(array( ‘id’ => ‘sidebar-widget-1’, ‘name’ => ‘Sidebar Widget 1’, ‘before_widget’ => ”, ‘after_widget’ => ”, ‘before_title’ => ”, ‘after_title’ => ”, )); and it is showing in Appearance -> Widgets and it is also showing content on frontend using dynamic_sidebar(‘Sidebar Widget 1’). But I […]

Prevent widgets from disappearing when swtiching from parent to child theme

I have a parent theme with 2 widget areas, header, sidebar, and footer, the header and the footer have 2 simple text widgets in them. When I switch to the child theme which consists of just style.css and functions.php to enqueue the stylesheet, both the widgets are removed, they are also not in the inactive […]

Can't save widget multiselect option

I’m new to WordPress and PHP in general, I’m now trying to create a posts slideshow widget using this plugin as the base code: https://wordpress.org/plugins/ts-widget-pack/ This is my widget code: <?php /** * Slideshow widget * * @package TS Widget Pack * @version 1.1 */ /** * Adds TS_Widgets_Slideshow widget. */ add_action( ‘widgets_init’, create_function( ”, […]

Recent posts widget using filters is selecting additional post types

A month ago I implemented this recent post widget filter and it worked perfectly. Recently, I added an opt-in plugin and the recent post widget has been displaying links to recently published opt-in widgets. The links that are showing look like this: example.com/?post_type=opt_in_form_type Unfortunately, this code did not solve the problem: add_filter( ‘widget_posts_args’, function( $args […]

How to change the order of a widget instance?

I have to edit a widget we made so our customer can change the order of the entities (images). So, I added a sort meta_key meta_value pair at the *_postmeta table. Now at the rendering site of the widget I need to access that sort value. This is the output part: class WidgetBoxEmployees extends WP_Widget […]

Simple SCript Not Displayed in WIdth

Here is my script that is supposed to display basic information from a Discord server in a non-bulky way. I have tested this on other platforms (plain HTML, Invision Power, etc) but it won’t display for some reason. I’ve tried various “extended” widget plugins with no luck. ANy help is appreciated. <script type=”text/javascript” src=”http://www.drmath.xyz/js/discord.min.js”></script> <script […]

Plugin showing error

I recently made up simple Minecraft site about one starting server, instaled plugin called:Minestatus, and getting these errors. Exact same error for one other plugin. I am running WP 3.19.4 Warning: Declaration of Minestatus_Widget::widget(array $args, $instance) should be compatible with WP_Widget::widget($args, $instance) in /data/web/virtuals/151993/virtual/www/domains/clashofcraft.eu/wp-content/plugins/minestatus/widget.php on line 6 Warning: Declaration of Minestatus_Widget::form(array $instance) should be compatible […]

Restore widget text from database

I am about giving up here and resorting to individually recreating each of 50+ sidebars. The text in all widgets has been lost from the database. I have a backup of slightly over a week ago, but in that time many changes have been made, including updates to plugins. I can’t see how to add […]

What php snippet should I add to my child theme's functions.php if I want to bold only part of the title of a widget?

What php snippet should I add to my child theme’s functions.php if I want to change the font-weight of only part of the title in a widget (tg: vertical promo widget) and how do I add that function to my child theme? Please explain step by step, very much a beginner here and have spent […]

Add Control in Widgets Sub-Panel in Customizer

Is it possible to add controls to sub panels of the widgets panel in the customizer? If yes, how do I address them? The widget area would be named “top-widget-area” Neither addressing: ‘panel’ => ‘widgets-top-widget-area’ nor ‘section’ => ‘widgets-top-widget-area’ in $wp_customize->add_control work. Do you have an idea?