index page is not loading [closed]
You’re missing a semicolon on your add_action.
You’re missing a semicolon on your add_action.
Take a look at the official docs: https://codex.wordpress.org/Child_Themes https://developer.wordpress.org/themes/advanced-topics/child-themes/ Make sure you are within your child theme functions.php and use this code to make sure the function is firing. It will kill the page if it is working correctly. function wpdocs_theme_name_scripts() { wp_die(‘Yep! This is working’); } add_action( ‘wp_enqueue_scripts’, ‘wpdocs_theme_name_scripts’ );
I figured out the problem. It was working all along. The site I’m working on had installed a plugin called ‘Autoptimize’ which will shove all your CSS into an inline <style> tag. I was trying to search the output HTML for a reference to my CSS file, but it wasn’t there, because this plugin was … Read more
WooCommerce conditional to test if a Product is Variable. global $product if( $product->is_type( ‘variable’ ) ){ // a variable product } Found it here: https://gist.github.com/patrickgilmour/9d4a28b4a2f0c1dcecbf and here https://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable.
You need to use the admin_enqueue_scripts hook. As you can imagine, you’re not the first one to attempt that: WordPress admin stylesheet
WordPress features a very robust template hierarchy that should be observed, take a look at wphierarchy.com. If you needed two header formats for some reason, you could create a file in the theme root called header-manga.php which you could then call in your page template with <?php get_header( ‘manga’ ); ?>. Once you have your … Read more
esc_url is run on the stylesheet URL and that converts those characters. You can work around it with a couple of filters. function style_params($src, $handle) { if (‘twentyfourteen-style’ == $handle) { add_filter(‘clean_url’,’alter_clean_url’,10,3); } return $src; } add_filter(‘style_loader_src’,’style_params’,10,2); function alter_clean_url($good_protocol_url, $original_url, $_context ) { remove_filter(‘clean_url’,’alter_clean_url’,10,3); $good_protocol_url = html_entity_decode($good_protocol_url); $good_protocol_url = $good_protocol_url.’&abc=def’; return $good_protocol_url; }
use wp_head(); before </head> in header.php
You need to use the correct hook. Currently, WordPress has a hook for enqueueing scripts: wp_enqueue_scripts, but does not have an analogous hook for enqueueing stylesheets, such as wp_enqueue_styles. So, for the time-being, hook your stylesheet-enqueueing callback into wp_enqueue_scripts.
You can only register a single file with the handle shop-style. Once you enqueue something with that handle, subsequent calls to wp_enqueue_style with the same handle will be ignored.