Disable the Custom Internal CSS added by theme.json for Certain Pages

We can look into the wp_enqueue_global_styles() function, that calls wp_should_load_separate_core_block_assets() and see it contains e.g. the should_load_separate_core_block_assets filter but we can’t disable the global styles on the front-end, using this filter because of: /* * Global styles should be printed in the head when loading all styles combined. * The footer should only be used … Read more

Adding WordPress colorpicker in widget settings

The following worked for me. I using class attribute instead of ID to match multiple color pickers. <script type=”text/javascript”> jQuery(document).ready(function($) { jQuery(‘.color-picker’).on(‘focus’, function(){ var parent = jQuery(this).parent(); jQuery(this).wpColorPicker() parent.find(‘.wp-color-result’).click(); }); }); </script> My Widget form is set up like : <p> <label for=”<?php echo $this->get_field_id( ‘font_color’ ); ?>” style=”display:block;”><?php _e( ‘Font Color:’ ); ?></label> <input … Read more

How to allow admins to create a sidebar from the admin

Create a function that register sidebars, using register_sidebar, starting from an option: add_action(‘widgets_init’, ‘my_custom_sidebars’); function my_custom_sidebars() { $sidebars = get_option(‘my_theme_sidebars’); // get all the sidebars names if ( ! empty($sidebars) ) { // add a sidebar for every sidebar name foreach ( $sidebars as $sidebar ) { if ( empty($sidebar) ) continue; register_sidebar(array( ‘name’ => … Read more

Getting Permalink within the loop

As suggested, went to the function reference and from there to the Source File (located in wp_includes/link-template.php) in which there are four functions that each return similar results. <?php echo get_post_permalink() ?> http://newdep.localhost/instruments/jester/ <?php echo post_permalink() ?> http://newdep.localhost/instruments/jester/ <?php the_permalink() ?> /instruments/jester/ <?php echo get_the_permalink() ?> http://newdep.localhost/instruments/jester/ In this case, since this is a custom … Read more

Convert a static website to a WordPress theme and import all existing content

WordPress has a perfect wrapper for HTML > Theme conversion: The theme itself. All information can be found in the Codex page. It is enough to add a folder to your wp-content/themes directory (or whatever directory you registered in addition to that), and add the following files functions.php style.css index.php header.php to your custom themename … Read more

Fatal error: Maximum execution time of 60 seconds exceeded in H:\wamp\www\custom\wp-includes\class-wp-http-curl.php

I get that answer. I go to this file: wp-includes/deprecated.php and find this line in (deprecated) wp_get_http() function: @set_time_limit ( 60 ); just comment out this line and it works fine. Because wordpress hard coded that 60 seconds limit, this hard coded setting was over-ridding my php.ini settings. so I comment out that line, my … Read more

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