Usually, I can replace the template files and PHP codes of any parent classic theme with child themes. Since block-based theme templates rely on HTML, how can I replace parent block-based theme files and code with child themes?
In a parent theme (Foodica Pro) functions.php I have function foodica_scripts(), where css and js are loaded in page header, including: wp_enqueue_style( 'media-queries', get_template_directory_uri() . '/css/media-queries.css', array(), WPZOOM::$themeVersion ); This media-queries.css will take a lot of work to overwrite (using different breakpoints). I want to avoid loading this css file, but without touching parent theme. Is there any way to do it in child theme only?
According to the codex, when creating a child theme, you have to manually enqueue the parent theme's scripts. My parent theme has logic to conditionally display various css files, cached css, and dynamic css generated from a Theme Options dashboard. The theme is called Camille. function camille_scripts() { wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.css'); wp_enqueue_style( 'bootstrap' ); //...more scripts & styles } function camille_enqueue_dynamic_styles( ) { //renders wp_options to physical file & enqueues physical file //... wp_register_style( $cache_file_name, $css_cache_file_url, $cache_saved_date); wp_enqueue_style( $cache_file_name …
I was wondering how can I load parent theme template parts through child theme after customization. I have created three custom template for my theme and they are working fine. But now I want to load parent theme template parts layout. For example if I want edit profile page the location of the PHP file in parent theme is template_parts/layouts/profile/profile-modern.php In that folder there are other parts profile-header.php and other files. I tried to edit the profile-mordern.php directly in the …
I am using the Pricerr theme. In my parent theme I have a CSS folder with a few css files in it, a rtl.css and a style.css. What should be the code to put in the functions folder so that I can pull the info from the parents theme? And am i on the right track for identifying this as the error when they say "The parent theme is missing. Please install your parent theme?" I've checked and my parent …
Client has a very strange request where they want to just install Child theme and have the parent theme be inside child theme. So essentially, they don't want to show parent theme in the list of Available or installed themes in WP theme section. Wondering if this is even possible? Thoughts?
My WordPress site uses a theme that is a child of a parent theme. As required, both themes have style.css files. However, as far as I can tell WordPress only provides the mechanism to load the child theme style.css file. How do the parent theme styles get loaded? Is it necessary to manually import the parent theme's style.css file into the child style.css file?
I have been trying to change my HTML website over to Wordpress. When I load the new theme, it says it is installed but that the Parent Theme is missing, please install. How do I do that? I have copy and pasted all the code into the files to transfer it to Wordpress. These files are header.php, footer.php, style.css, and sidebar.php. This website was designed years ago and was HTML. I feel like I am really close but I don't …
A few years back, I made some css and template changes directly in my parent theme, because Wordpress was new to me and that seemed easier than messing around with this child theme stuff. It worked fine and I only had to redo it once when the theme updated. Fortunately I had kept records of my changes. Now I have more changes to do and decided to learn how to do it the right way. So far I can't even …
Presumably a common question, but I'm having some difficulty as it's my first time editing WordPress themes. I'm trying to create child theme based on Zincious. This is all fine for CSS, but when it comes to editing HTML, it doesn't work. I have the same file name and path as the original. Any idea what could be going wrong? All I'm trying to do for now is comment out / delete a div. Thanks very much.
I am trying to create a child theme for the Fitness Hub theme. I'm following this guide (https://developer.wordpress.org/themes/advanced-topics/child-themes/), when it comes to part 2. it makes it clear I need to add a 'Template' header in the style.css (of the child theme), however there isn't a template name in the parent theme's style.css. So it's not clear to me what this template name should be. I used 'Template: fitnesshub', but this doesn't work, the child theme does not generate. I …
I am trying to overwrite a template file (tpl-footer.php) in my child-theme. According to the wordpress docs this should be possible just by adding the file with the same name and the same path into the child-theme. When I do so, nothing happens. The theme I use is snsnitan Does anyone know what I am missing? Do I need to overwrite more files? The footer.php in parent theme has just: <?php wp_footer(); ?> </body></html>
I am trying to use child themes for the first time in Wordpress - and I've got it working (at least from a user's perspective - it functions correctly) My concern is that both the parent and child CSS files are loaded - so I'm concerned about performance. Ideally, I just want the child's CSS file used. My code in functions.php is the following - does anyone have any suggestions how to just rely on the min.css file from the …
How do I get the parent theme's version in a child theme? I want to use it when loading the parent theme's stylesheet. Here's how I load the stylesheets in the child theme's functions.php file: function sometheme_enqueue_styles() { // Get parent theme version $parent_theme_version = wp_get_theme()->parent()->get( 'Version' ); // Load parent theme stylesheet wp_enqueue_style( 'sometheme-style', get_template_directory_uri() . '/style.css', array(), $parent_theme_version ); // Load child theme stylesheet wp_enqueue_style( 'sometheme-child-style', get_stylesheet_directory_uri() . '/style.css', array( 'sometheme-style' ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'sometheme_enqueue_styles', …
I am using Buttercream as my parent theme. I have translated the .mo file located in themes\buttercream\languages and saved it as nl_NL.mo and nl_NL.po. Now I want to display the parent theme in Dutch (nl_NL). I can't edit functions.php of the parent theme because if it gets updated I'll lose my changes. What do I have to do to get the theme in another language?
So I've tried a few different ways to override a method inside the parent theme and I'm not having much luck at all. So here is the structure: themes/ - wp-starter -- custom_header.php - wp-starter-child -- custom_header.php I have a method inside the parent custom_header.php as shown below: function wp_bootstrap_starter_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'wp_bootstrap_starter_custom_header_args', array( 'default-image' => '', 'default-text-color' => 'fff', 'width' => 1000, 'height' => 250, 'flex-height' => true, 'wp-head-callback' => 'wp_bootstrap_starter_header_style', ) ) ); } add_action( 'after_setup_theme', …
I'm using the well-written Oenology theme by Chip Bennett as the Parent to my own Child theme. In my development process, I've discovered that there are some challenges for people writing Child themes when it comes to controlling styles. I've just discovered that my main style.css file gets loaded before every other stylesheet link or statement in <head>, and this explains why I was having trouble overriding some of the Parent styles. further study of the problem shows that various …
I'm trying to remove a parent theme's add_action call to a pluggable function, but can't get it to work by calling remove_action() - I have to redeclare the function and just leave it empty. Is this normal? I'd think I could use remove_action to simply never call the function. Here's the parent theme code: add_action( 'tha_content_while_before', 'fwp_archive_header' ); if ( !function_exists('fwp_archive_header') ) { function fwp_archive_header() { // do stuff } } And in the child theme (NOT working): add_action( 'init', …
How would I replace this function that lies inside inc/template-tags.php in my parent theme function theme_navigation() { ?> <div id="theme-nav-container"> <nav id="site-navigation" class="main-navigation"> <?php wp_nav_menu( array('theme_location' => 'theme-studios-primary', 'menu_class' => 'sf-menu', 'fallback_cb' => false, 'walker' => new theme ) ); ?><div class="clearfix-pro"></div> </nav> <div class="clearfix-pro"></div> </div> <!-- close #theme-nav-container --> <?php } There is no add action that it is hooked on to, there is no check to see if the function already exists. How would I replace it without …