Enqueue custom font file with rel=”preload”

You could try using the style_loader_tag filter. add_action(‘wp_enqueue_scripts’, ‘my_enqueue_scripts’); function my_enqueue_scripts() { wp_enqueue_style(‘my-style-handle’, “https://wordpress.stackexchange.com/fonts/custom-font-folder/CustomFontFile.woff2”, array(), null); } add_filter(‘style_loader_tag’, ‘my_style_loader_tag_filter’, 10, 2); function my_style_loader_tag_filter($html, $handle) { if ($handle === ‘my-style-handle’) { return str_replace(“rel=”stylesheet””, “rel=”preload” as=”font” type=”font/woff2″ crossorigin=’anonymous'”, $html); } return $html; } Here we’re enqueuing the stylesheet using the normal wp_enqueue_style function. We then capture the … Read more

Loading a child-theme’s style.css after the parent’s

As @Andy Macaulay-Brook pointed out WordPress doesn’t load child-theme’s style.css . I guess parent theme might be en-queuing it. De-queue the child-theme style.css first and then enqueue it En-queue parent’s style.css before child theme’s style.css De-queue the child-theme style.css You can de-queue the child-theme’s style.css by using the handle.You can find out the handle either … Read more

How does one load style.css into a theme?

Make sure you have the files named and labeled correctly and in the right place. functions.php located @ mytheme/functions.php <?php /** * Theme Functions */ function theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); } add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ ); style.css located @ mytheme/style.css /* Theme Name: Twenty Thirteen Theme URI: http://wordpress.org/themes/twentythirteen Author: the … Read more

What is the correct way to enqueue multiple CSS files?

The wp_enqueue_style() function uses the following format and parameters: wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media=”all” ); In your case, you could try the following: <?php /** * Proper way to enqueue scripts and styles */ function namespace_theme_stylesheets() { wp_enqueue_style( ‘mamies-wafers-bootstrap-min’, get_template_directory_uri() .’/css/bootstrap.min.css’, array(), null, ‘all’ ); wp_enqueue_style( ‘mamies-wafers-carousel’, get_template_directory_uri() … Read more

Issues enqueueing parent & child theme stylesheets with revised Codex method

QUESTION 1 Is it safe to include the assumption that parent themes properly enqueue the child theme styles, from the standpoint of child theme standards? General rule of thumb, yes. But, you should never assume. Most disasters and failures in live are due to assumptions or facts based on an assumption FACTS WITHOUT ASSUMPTIONS A … Read more

WordPress admin stylesheet

Take a look here at the CODEX for an example on how to do this very thing. Example: Load CSS File on All Admin Pages function load_custom_wp_admin_style(){ wp_register_style( ‘custom_wp_admin_css’, get_bloginfo(‘stylesheet_directory’) . ‘/admin-style.css’, false, ‘1.0.0’ ); wp_enqueue_style( ‘custom_wp_admin_css’ ); } add_action(‘admin_enqueue_scripts’, ‘load_custom_wp_admin_style’); Example: Target a Specific Admin Page function my_enqueue($hook) { if( ‘edit.php’ != $hook ) … Read more

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