All software is up-to-date and no other plugins are in use. I’ve tested with your option for block editor support turned on and turned off, to no avail.
]]>Thanks in advance.
]]>Any suggestions for why this might be the case?
add_action( ‘wp_enqueue_scripts’, ‘add_theme_scripts’, 100 );
function add_theme_scripts() {
wp_dequeue_script(‘wc-single-product’);
wp_enqueue_script( ‘single-product’, get_stylesheet_directory_uri() . ‘/woocommerce/assets/js/frontend/single-product.min.js’, array ( ‘jquery’ ), 3.6, true);
}
https://drive.google.com/file/d/18ohZklHKLGdVdR0O-iFRw_qBXWEjmE5q/view?usp=sharing
]]>My parent theme functions.php then enqueues the child theme style.css as it is supposed to do.
Unfortunately the child theme css overwrites the page specific syles
How do I, a 75 year old, so be gentle in your replies, solve this?
]]>I am attempting to create a Child Theme for the parent theme, ForeverForest.
Here is the piece to creating the Child Theme that is confusing me:
maintain all of the Parent Theme dependencies
I believe ForeverForest contains multiple style sheets/files.
Can you tell me the correct functions code to put into the child theme functions file to import the parent CSS properly?
(I understood @import. I do not understand enqueuing.)
The site “breaks” each time I active the child theme I’ve created – the CSS isn’t loading.
Here is a link to the site I am working on: speechtherapymarin.com
TIA,
Greg
// deregister the jquery version bundled with wordpress
wp_deregister_script('jquery');
// register scripts
wp_register_script( 'modernizr', get_template_directory_uri() . '/bower_components/modernizr/modernizr.js', array(), '1.0.0', false );
wp_register_script( 'jquery', get_template_directory_uri() . '/bower_components/jquery/dist/jquery.min.js', array(), '1.0.0', false );
wp_register_script( 'custom', get_stylesheet_directory_uri() . '/js/custom.min.js', array('jquery','modernizr'), '1.0.0', true );
// enqueue scripts
wp_enqueue_script('custom');
But the jquery wp_deregister_script seems to conflict with the way you’re enquiing your assets, because I get this js error :
Uncaught TypeError: $(...).live is not a function
Changing .live (now depcrecated) to .on in the different files using seems to partly fix the issue (although it creates some problems).
Could you look into it?
https://www.ads-software.com/plugins/w4-post-list/
]]>I’m attempting to use the method recommended in the Codex: “The correct method of enqueuing the parent theme stylesheet is to use wp_enqueue_script() in your child theme’s functions.php.”
For reference, here’s how Pego enques their parent stylesheet styles.css (you’ll see that other stylesheets are used in this theme but this main one is the only one I need to overrule) …
function pego_theme_styles() {
global $pego_prefix;
wp_enqueue_style( 'flexslider-style', get_template_directory_uri() . '/css/flexslider.css', array(), '1.0', 'all' );
wp_enqueue_style( 'widgets-style', get_template_directory_uri() . '/css/widgets.css', array(), '1.0', 'all' );
wp_enqueue_style( 'icons-style', get_template_directory_uri() . '/css/icons.css', array(), '1.0', 'all' );
wp_enqueue_style( 'default-style', get_template_directory_uri() . '/style.css', array(), '1.0', 'all' );
if ( is_admin() ) {
wp_enqueue_style('admin-style', get_template_directory_uri() .'/css/admin-style.css', false, '1.0', 'all');
}
if ( function_exists( 'ot_get_option' ) ) {
if (ot_get_option('clearix_layout_type') == 'boxed') {
wp_enqueue_style( 'boxed-style', get_template_directory_uri() . '/css/boxed.css', array(), '1.0', 'all' );
}
}
wp_enqueue_style( 'media-style', get_template_directory_uri() . '/css/media.css', array(), '1.0', 'all' );
}
add_action('wp_enqueue_scripts', 'pego_theme_styles');
… and here’s the code I’m using in my child theme’s functions.php:
function theme_enqueue_styles() {
wp_enqueue_style( 'default-style', get_template_directory_uri() . '/style.css', array(), '1.0', 'all' );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
Also for reference, here’s the top of my child’s styles.css:
/*
Theme Name: Clearix Child
Theme URI: https://staging.parkhillvet.com/wp-content/themes/clearix-child/
Description: Clearix Child Theme
Author: Andy Campbell Creative
Author URI: andycampbellcreative [at] gmail [dot] com
Template: clearix
Version: 1.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
That “Template” line features “clearix” — that is exactly how the parent theme’s file directory is named.
What am I doing wrong here? Apologies if this information may be found somewhere on the Codex — I searched and couldn’t find anything that helped — or if I’ve left any information out.
My site may be found at https://staging.parkhillvet.com. It’s currently using the parent theme until I lick this issue; let me know if it needs to be set to the child in order to diagnose this issue.
Thanks in advance for any time spent diagnosing this.
]]>Are there any plans to fix this?
https://www.ads-software.com/plugins/all-in-one-event-calendar/
]]>