Questions tagged [child-theme]

Child theming is a safe way to modify a theme. A child theme inherits a "parent themes" styles and then can selectively override. This alternative to "destructive" editing allows for safe updating of the parent theme and provides an easy way to undo theme changes.

Filter by
Sorted by
Tagged with
3 votes
3 answers
3k views

override parent theme configuration in child functions.php

Hope someone can help, am looking for some suggestions on how to override/replace some functions that are loading in a parent theme and move them into the child theme so we can make alterations to the ...
CMYK's user avatar
  • 31
31 votes
1 answer
17k views

How to override parent functions in child themes?

I've been reading around and trying to figure out how to do this, but for some reason I can't seem to override parent functions in my child theme. I'm using TwentyTen as a parent - can anyone tell me ...
Osu's user avatar
  • 1,442
29 votes
3 answers
97k views

Versioning @import of parent theme's style.css

Context I built a child theme based on Twenty Thirteen which works quite well. After updating the parent theme to version 1.3, I noticed strange behavior with the styling which was caused by a cached ...
bernie's user avatar
  • 501
3 votes
2 answers
3k views

Are custom inner theme folders in any way overridable by child themes?

Basically, I'm trying to override some files of the Uncode theme. But this is not a theme-specific question: it can be applied to any theme. The Uncode theme has a custom dir 'partials' (/uncode/...
Luca Reghellin's user avatar
50 votes
7 answers
118k views

How to customize the_archive_title()?

In my child theme's archive.php, I have the following code for displaying the title of my archive pages: <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?&...
fildred13's user avatar
  • 603
23 votes
1 answer
22k views

Why does my child theme CSS get called twice?

I created a child theme according the WP docs and added the requisite function <?php add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX); function ...
mmcglynn's user avatar
  • 386
16 votes
2 answers
2k views

How do themes provide support for child themes?

One of the requests on themeforest is that themes are required to provide child theme support. I know what child themes are, although I haven't worked a lot with them, but I would like to know is ...
Valeka's user avatar
  • 301
9 votes
1 answer
18k views

Issues enqueueing parent & child theme stylesheets with revised Codex method

This post brings up a few questions I've encountered pertaining to the recent changes around stylesheet enqueueing methods brought up in this thread and this thread. The issues I encountered came up ...
dMcClintock's user avatar
44 votes
3 answers
2k views

Opinions and recommendations on the best barebones base theme [closed]

Preamble I'm finding myself building more and more WP sites "from scratch" as it were (ie: ignoring any theme designs out there and just creating a design wireframe purely on the needs of the client. ...
Tom Auger's user avatar
  • 7,016
39 votes
2 answers
46k views

How do I dequeue a parent theme's CSS file?

My parent theme (Starkers) adds a CSS file that I'm trying to remove (I want to use @import instead so I can override styles more easily). Starkers has the following in its functions.php: add_action( ...
jmotes's user avatar
  • 557
19 votes
6 answers
21k views

How to *remove* a parent theme page template from a child theme?

I'm using the TwentyTen theme to create a child theme, but I can't seem to get rid of the 'One column, no sidebar' page template that is in the TwentyTen parent theme. I thought just copying it over ...
Osu's user avatar
  • 1,442
14 votes
2 answers
51k views

Adding a second email address to a completed order in WooCommerce [closed]

Before I ask this question, I know there is a (legitimate) hesitation to answer questions here about Woo products since they have their own support and their users should be encouraged to use that. I ...
Halle's user avatar
  • 259
1 vote
2 answers
2k views

Override parent theme function that is not hooked or in the functions.php file

I need to remove a function from the parent theme and replace it within the child theme. The function is called print_meta($meta_box). The function is not pluggable and it located in a random file, ...
Jason's user avatar
  • 606
20 votes
3 answers
56k views

How to properly dequeue scripts and styles in child theme?

I made a parent theme and a child theme in one of my project. I enqueued CSS and JavaScripts in my parent theme like below: function project_necessary_scripts() { //Stylesheets ...
Mayeenul Islam's user avatar
13 votes
3 answers
22k views

Override parent theme translation on child theme

I have a parent theme that uses correctly load_theme_textdomain() to load all the translated strings in many languages. Then I created a child theme that uses load_child_theme_textdomain() to achieve ...
d79's user avatar
  • 577
12 votes
4 answers
9k views

Is it possible to override the result of get_template_part()?

I'm working on a child theme, I strongly prefer not to override the main template files in order to maintain simplicity of the child theme as well as minimize the amount of code and maintenance over ...
TomHarrigan's user avatar
8 votes
1 answer
20k views

How do I cleanly override a plugin's CSS with a child theme?

I have taken it upon myself to adhere to WordPress conventions so I can have a clean, sexy child theme. However, I am unsure how to proceed on a certain issue. I would like to override the CSS for ...
Jordan Thornquest's user avatar
4 votes
2 answers
3k views

jquery script not enqueued in child theme

I need a little bit of insight here with the following problem? I've created a child theme called 'test_child' which I am trying to extend in the following way: This is the test_child/functions.php ...
Mpampirina's user avatar
4 votes
2 answers
11k views

Is it possible to disable a function of a parent theme?

I was wondering whether it is possible to completely disable a function that is called in a parent theme's functions.php and if so, how? (Of course without deleting the function. Rather by adding ...
Bram Vanroy's user avatar
4 votes
4 answers
48k views

Child theme does not overwrite parent themes style.css

I just created a child theme but every change I make in the style.css does not overwrite the parent style.css - other files work. I just did it like that: Making new Childtheme Folder in the Theme ...
Jan's user avatar
  • 41
20 votes
3 answers
20k views

remove_action on after_setup_theme not working from child theme

I am trying to remove a theme action for an elegant-themes theme using a child theme.. This works when I remove action after add_action code anywhere in the parent theme functions.php. However, it ...
Smoking Sheriff's user avatar
16 votes
7 answers
27k views

Attributing a version number to a child theme's main stylesheet

In header.php, I like to attribute a version number to the stylesheet so that the browser gets forced to refresh it. But when working with a child theme, its stylesheet is not explicitely called, ...
drake035's user avatar
  • 1,125
15 votes
2 answers
7k views

Is it possible to make grandchild themes?

If I use one of the popular frameworks such as Genesis, is it possible to create grandchild themes? As an example, I want to use Genesis as the backbone of all my sites. Genesis is called a framework ...
urok93's user avatar
  • 3,984
8 votes
3 answers
6k views

How to override function in child theme

I have created a child theme. In the parent theme there is a file functions_custom.php, which has some functions definitions. The file included in functions.php in the parent theme. Now I want to ...
Vinaya Maheshwari's user avatar
4 votes
1 answer
2k views

Adding Action Hooks In Parent Theme For Easier Child Theme Customization

I was wondering why isn't anyone (haven't be able to find one with it) adding custom hooks an the beginning and at the end of the theme's function.php for theme development. The reason I'm asking ...
Bobby's user avatar
  • 313
3 votes
1 answer
579 views

Child theme preview missing

I followed the beginner steps for creating a child theme. The child theme was created and it appears as an option on my Themes page. But unlike the other Themes on the page (including its parent), ...
cag8f's user avatar
  • 1,837
2 votes
3 answers
2k views

Developing a childtheme, how to disable the parents templates?

I am developing a simple child theme based on twentyeleven. But i notice twentyeleven has a showcase and sidebar template when you add a new page. How can i disable these templates from functions.php? ...
alex's user avatar
  • 1,122
1 vote
1 answer
966 views

How to pass a numeric id to a page template?

I am using a Wordpress installation with Wordpress Social Login as a "canvas" for an HTML5-based board game. In the file /wp-content/themes/twentythirteen-child/front-page.php I get the numeric ID of ...
Alexander Farber's user avatar
1 vote
2 answers
3k views

How to avoid loading style.css twice in child-theme?

I have twentyseventeen child-theme, and I found this code: add_action( 'wp_enqueue_scripts', 'child_enqueue_styles',99); function child_enqueue_styles() { $parent_style = 'parent-style'; ...
kibus90's user avatar
  • 151
0 votes
1 answer
448 views

Function in Child Theme not overriding Parent Theme function [duplicate]

I have read up on this and tried it myself, but I cannot seem to figure out how to override a parent theme function using my child theme. I need to know what I am doing wrong (and I am sure there are ...
Joseph's user avatar
  • 5
43 votes
5 answers
74k views

How to override JavaScript files in child theme?

I'm loading some JavaScript files in the parent theme. The path in the parent theme is: scripts > custom.js In the child theme, I'm creating the same path (scripts > custom.js) and changing ...
Christopher John's user avatar
27 votes
3 answers
87k views

How to add code to Header.php in a child theme?

I'm creating a child theme for the first time and I had a few questions regarding code added to header. In a non child theme there is certain code I add to my header.php file such as google ...
Rick Smith's user avatar
18 votes
2 answers
18k views

Remove parent theme action in child

I'm creating a child theme from Storefront. Now I want to remove these action in child theme add_action( 'woocommerce_before_shop_loop','storefront_sorting_wrapper',9 ); by this function: ...
Ehsan's user avatar
  • 435
17 votes
1 answer
3k views

How do I make my child theme re-apply the settings that were customised when its parent was active?

Scenario Pick 2015 theme. Customize various settings, such as background picture, header picture, site name and tagline. But don't touch the contents of any of the theme's files. Use Codex' Child ...
Marjan Venema's user avatar
15 votes
6 answers
8k views

Preserving theme settings in child theme

My client uses Karma theme with many settings in theme options. I need to keep my CSS and PHP additions in a child theme so that theme updates don't wipe it out. However when I select my child theme ...
drake035's user avatar
  • 1,125
10 votes
1 answer
12k views

Child theme - Overriding 'require_once' in functions.php

I am attempting to modify a wordpress theme with a child theme. My parent theme has the following function in its functions.php: require_once(get_template_directory() . "/includes/theme-styles.php"); ...
Alex's user avatar
  • 103
7 votes
2 answers
8k views

why is translation not working on theme?

Background I am using the theme Rookie from Sportpress. I created a child theme. Translation files are existing, especially german in my case. Wordpress is set to german language. The Problem ...
André Kelling's user avatar
6 votes
1 answer
15k views

WordPress Multisite Multiple child theme

I have a mulisite setup and I am using one theme for multiple sites in it and each site have a custom layout and design. So for that I need to create a child-theme. But I don't know how to create ...
Jamil Ahmed's user avatar
6 votes
3 answers
36k views

Give priority to child theme stylesheet

I've created a child theme and the main style.css works perfectly fine. However, the parent theme has another stylesheet which I want to import and create the same for child theme and use it instead. ...
nimsrules's user avatar
  • 208
5 votes
1 answer
4k views

get_parent_theme_file_path vs. get_template_directory

I've been reading about the new functions for referencing theme location added in v4.7. I read through the trac ticket. I understand why they created these functions and the benefit of ...
Sirmontegu's user avatar
5 votes
1 answer
5k views

Declaring an instance of class included in parent theme from child theme functions.php

Please note this is all "working" - the question is about the best practice and to try and work out why I need to include the PHP file which contains the class in two places for it to work correctly. ...
Q Studio's user avatar
  • 2,506
4 votes
1 answer
5k views

How to override function in functions.php of parent theme?

I have created child of theme twentyten. I tried to override function written below /** * Returns a "Continue Reading" link for excerpts * * @since Twenty Ten 1.0 * @return string "Continue ...
user478's user avatar
  • 333
4 votes
2 answers
5k views

Assign Menus to Theme Locations with theme activation

A site is using "child1" named child theme. When this site switches to other child theme named "child2", their widgets are moving too but theme locations are not moving. How can i auto assign menus to ...
Ünsal Korkmaz's user avatar
4 votes
3 answers
9k views

how to call files in child theme?

I created a child theme "my-theme" . In style.css I wrote nothing just the mandatory details I wrote there. /* Theme Name: my-theme Theme URI: http://example.com/ Description: Child theme ...
Bhuvnesh Gupta's user avatar
3 votes
2 answers
15k views

Is it possible to override this function/class in a child theme?

Is it possible to override this widget function from a parent theme? I saw this blog, but it dealt with a simpler case. http://venutip.com/content/right-way-override-theme-functions parent class ...
Chloe's user avatar
  • 245
3 votes
1 answer
555 views

Hard Code Pages into a Theme for a Network (multisite) Installation

I'm creating a multisite network and I am looking for a way to have it so new blogs that are created have a couple of standard pages set up automatically. The purpose of these pages will be to ...
jw60660's user avatar
  • 1,506
3 votes
1 answer
496 views

How could child theme be different than parent theme if I haven't made changes?

I made a child theme defined as so: /* Theme Name: GlenTheme Description: Modified Gallery 2.3 theme Template: gallery */ @import url("../gallery/style.css"); The only file in the child theme is ...
Damon's user avatar
  • 275
2 votes
2 answers
2k views

Change parent theme file function in child themes functions.php

im trying to understand how Action Hooks and Filters work and have this example i want to edit This function is in a parent theme framework php file: public function formatArticleCat01( $...
nameless's user avatar
2 votes
3 answers
2k views

Copy customizer options to child theme

I am using the OceanWP theme and customized it with the WordPress Customizer feature. Then, I created a child theme based on OceanWP, because I introducted some new shortcodes and did not want to ...
user1438038's user avatar
2 votes
1 answer
2k views

Child Theme, Functions.php Issues

I've been toiling, probably way too long, with a simple Child Theme for a version of Fukasawa. I know that the @import method is deprecated. I also know that enqueuing it the preferred method. But... ...
Veeps's user avatar
  • 21