WordPress Customizer not setting default value upon initial install?

I’ve managed to fix this by changing the operator on the ‘if’ statement: Original: ?> <style type=”text/css”> <?php if( get_theme_mod( ‘facebooklink_edit’ ) == ” ) { ?> #fb-footer-bg { display: none; } <?php } // end if ?> </style> <?php Updated: ?> <style type=”text/css”> <?php if( get_theme_mod( ‘facebooklink_edit’ ) === #fb-footer-bg { display: none; } … Read more

wp enqueue style and style sheet depth

You can add a priority number to the wp_enqueue_scripts action. So you could could give the action hooked to the enqueue of yourstyle sheet a priority of 999. Like so: function high_priority_style() { Wp_enqueue_style(‘important’, get_template_directory_uri() . ‘/css/important.css’); } add_action(‘wp_enqueue_scripts’, ‘high_priority_style’, ‘999’); A simpler way to do is enqueue all of your stylesheets, including style.css in … Read more

How to add custom fonts in WordPress site

This is the fontsquirrel config data. save as generator_config.txt and upload with your font file. select expert mode. # Font Squirrel Font-face Generator Configuration File # Upload this file to the generator to recreate the settings # you used to create these fonts. {“mode”:”expert”,”formats”:[“ttf”],”tt_instructor”:”ttfautohint”,”fix_gasp”:”xy”,”fix_vertical_metrics”:”Y”,”metrics_ascent”:””,”metrics_descent”:””,”metrics_linegap”:””,”add_spaces”:”Y”,”add_hyphens”:”Y”,”fallback”:”none”,”fallback_custom”:”100″,”webonly”:”Y”,”options_subset”:”basic”,”subset_range”:[“lowercase”,”uppercase”,”currency”,”malagasy”,”turkish”],”subset_custom”:””,”subset_custom_range”:””,”subset_ot_features”:”all”,”subset_ot_features_list”:””,”base64″:”Y”,”style_link”:”Y”,”css_stylesheet”:”stylesheet.css”,”filename_suffix”:””,”emsquare”:”2048″,”spacing_adjustment”:”0″,”rememberme”:”Y”}

Hide Add to Cart Button

Just add the following code in your functions.php and you will find button hidden I don’t know whether my solution is perfect. But it works. Normally if is_purchasable is returned to the filter woocommerce_is_purchasable, the ‘Add to Cart’ button is displayed, and if false is returned the button is hidden. So, you just need to … Read more

Why do WordPress default themes specify fonts in so many places?

There’s not a universal standard for this. The precedents that the core Themes are setting are incidental to rebuilding and innovating. They are not by design. They define font families for the Editor in the back end to establish a consistent feeling for content. Source: https://github.com/WordPress/twentysixteen/blob/master/css/editor-style.css Within the actual main styling of the Theme, there … Read more

How to load a css file in one page only?

You should be doing JS and CSS loading with wp_enequeue_script and wp_enqueue_style. Register the script at the init hook (or later) and then enquque it at the wp_print_scripts hook. Using this, you can say something like if( is_page( 42 ) ) : wp_enqueue_script( ‘my_script’ ); endif; and just call it a day. Additional Functions: wp_register_script(), … Read more