How to add css option to Header Image customizer?

So I guess you’ve register your custom header within your child themes functions.php file: add_theme_support( ‘custom-header’ ); Next locate the customizer section and append your own setting/controls for the theme customizer. Let’s say we want to register background_position and background_size and store it within an array custom_header_meta: add_action( ‘customize_register’, ‘wpse_customize_custom_header_meta’ ); function wpse_customize_custom_header_meta( \WP_Customize_Manager $wp_customize … Read more

How to put a site offline, including images?

You could load a request logger extension in your browser and visit all the pages of the live site, then check the list for any dev.example.com occurrences (or whatever the dev domain is.) A Firefox extension for example HTTP Request Logger, but this might be better for double-checking checking specific page changes as it would … Read more

How to create a control for css opacity in the Customizer

There is no such value of ‘type’ parameter in add_control() function. See the documentation. What you can do is create a control e.x.: $wp_customize->add_control( ‘my_control’, array( ‘label’ => __( ‘Opacity Control’, ‘mytheme’ ), ‘section’ => ‘my_section’, ‘settings’ => ‘my_setting’, ‘type’ => ‘text’, ) ); And then in file which you have <head> tag in (I … Read more

Basic Authentication problem with custom API endpoints

If you’re looking at actual “basic authentication”, check out the Basic Auth plugin. Note that it’s for the REST API plugin, not the core implementation, so you’ll need to adjust some filters. If you’re looking for authentiction for the current user based on their current cookies in the browser, the REST API has that built … Read more

website with pretty permalinks except pagination

WP permalink handling is sort of layered. They underlying “ugly” permalinks capture the actual logic of the system and the “pretty” permalinks are just cosmetic enhancement on top of it. Even when pretty permalinks are enabled, the original ugly permalinks still continue to work. But under normal circumstances they get redirected to a pretty version. … Read more

Load File (Function & Variable Value) from Child Theme

I would suggest to use the WordPress Customize API. There you can set as many fields as you want and all will be nicely shown in the theme’s Customize menu. <?php /* New Section in Customize */ add_action( ‘customize_register’,’new_customize_option’); function new_customize_option( $wp_customize ) { /* ————–REGISTERING NEW SECTION ————— */ $wp_customize->add_section( ‘rewp_logo’ , array( ‘title’ … Read more