WordPress Plugins won’t save

The most likely problem is that the theme is outdated and no longer compatible with some core WP functions, the theme was released in 2012 so it’s pretty old.

Display the id list of active widgets of same sidebar?

Despite what you say is_active_widget does work on custom widgets as well. You may just have trouble locating its ID. To help you, here’s a snippet that will show the ID of a widget on the widget admin. add_action(‘in_widget_form’, ‘wpse202950_get_widget_id’); function wpse202950_get_widget_id($widget_instance) { if ($widget_instance->number==”__i__”){ echo ‘<p class=”widget-id-message”>’ . __(‘Save the widget to get its … Read more

How to change plugin`s template (view) correctly?

Here is a little code snippet to get you started. This will query through the most recent custom post types named “custom_post_type”. Change this value to the name of the custom post you wish to query. <?php $args = array( ‘post_type’ => ‘custom_post_type’, // <– make sure to use the name of your custom post … Read more

Too many widgets

WordPress admin is not designed to scale. If you are managing some resource which is 100x more than the average site, you need to be prepared to either develop your own solution to admin it or learn to live with it. In the case of widgets you should try the customizer or the accessibility mode … Read more

How to determine the number of widgets contained in a sidebar via customizer JS

While you can look at the WidgetControl instances contained inside of a SidebarSection, it is better to instead to look at the underlying setting that lists out the widgets contained inside of the sidebar. So do something like this: wp.customize( ‘sidebars_widgets[sidebar-1]’, function( sidebarSetting ) { console.info( sidebarSetting.get().length ); } ); Alternatively, with a reusable function: … Read more

Include chat (HTML, js, css) in all pages of WordPress

Try to include your inline script at the bottom of your snipper.js file, and then enqueue it using wp_enqueue_scripts(): function my_chat_script() { wp_enqueue_script( ‘chat-js’, ‘URL OF SNIPPER HERE’, false ); } add_action( ‘wp_enqueue_scripts’, ‘my_chat_script’ ); This is the proper way to include scripts in your WordPress using functions.php file. However, if you insist on adding … Read more

Get widget Title from widget id

You can get the widget name from the widget id with this: <?php global $wp_registered_widgets; $id = ‘recent-comments-1’; // example if ( isset($wp_registered_widgets[$id][‘name’]) ) { echo $wp_registered_widgets[$id][‘name’]; } ?>

Wp Customizer event for when a new widget has been added

In order to interact with the event “widget-added” , you should enqueue your JavaScript file using “customize_controls_enqueue_scripts” to avoid it being part of the repetitively loading preview iframe ( where $(document) is different from the parent page document). I was able of interacting with the “widget-added” event using this example : in theme’s functions.php function … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)