Need advice on theme customizer and child themes

I would comment if able. If your theme variations consist solely of style modifications you can add the variation stylesheets @ inc/css/ and then here is an example of the references to make it all tick. @ \options\options-core.php: $fields_list[] = array( ‘name’ => __(‘Select a Skin Color’, ‘mytheme’), ‘id’ => ‘mytheme_skin_color’, ‘std’ => ‘default’, ‘type’ … Read more

How can I assign separate stylesheets to different pages?

The correct method is to enqueue the stylesheets, via callback hooked into wp_enqueue_scripts. You can add the contextual conditionals inside the callback: function wpse124258_enqueue_scripts() { if ( ! is_admin() ) { // Conditionally enqueue if ( is_front_page() ) { // Front page stylesheet wp_enqueue_style( ‘front-page-style’, get_template_directory_uri() . ‘/front-page-stylesheet.css’ ); } else if ( is_page() ) … Read more

How do I include an external PHP file in a subdir WordPress install?

In you case I’d edited my wp-config.php, and just after if ( !defined(‘ABSPATH’) ) define(‘ABSPATH’, dirname(__FILE__) . “https://wordpress.stackexchange.com/”); I’d added $path = explode( basename( dirname(__FILE__) ), ABSPATH ); define( ‘MYSITEROOTPATH’, $path[0] ); after that, everywhere I need, I’d used // file.php is name of a file in root directory include( MYSITEROOTPATH . ‘file.php’);

Usage of var keyword in the core

Normally WordPress backward compatibility is very strong, (sometimes too much strong IMHO). So it’s close to impossible that a public property (properties declared with var are public at any effects) become private in a future release. However, as you noticed, the variable is marked as private in class doc block, this mean that developers should … Read more

Prevent Company Name From Translating

In your example, the company name will not be translated. However, you should at least make it possible to write the name in the native alphabet. Latin letters look really odd in some other alphabets. There is also a legal issue: in some countries it is not allowed to use capital letters for anything but … Read more

How can I get plugin meta data without knowing the plugin folder?

If you know a function or class of the plugin’s main file, you can use the Reflection API. Example with my plugin T5 Taxonomy Location add_action( ‘plugins_loaded’, function() { $class=”T5_Taxonomy_Location”; if ( ! class_exists( $class ) ) return; add_action( ‘admin_footer’, function() use ( $class ) { $reflection = new ReflectionClass( $class ); $file = $reflection->getFileName(); … Read more

Why can’t I add a custom image in my navigation?

I figured it out. You have to search your style.css file and find /* Buttons */ Under that you will find the following classes .menu-toggle, article.post-password-required input[type=submit], .bypostauthor cite span {} .menu-toggle, button, {} button[disabled], input[disabled] {} .menu-toggle:active, .menu-toggle.toggled-on, button:active, {} There are 2 states of the button that you need to configure. Hover and … Read more