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
73 votes
3 answers
121k views

get_template_directory_uri pointing to parent theme not child theme

The problem I am having is that the get_template_directory_uri is pointing to the parent theme like site/wp-content/themes/twentythirteen/myGallery/gallery_functions_include.php but I want it to ...
Elroy Fernandes's user avatar
50 votes
7 answers
119k 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
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
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
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
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
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
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
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
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
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
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
78k views

WooCommerce: change display order of product short description and price [closed]

I'd like to move the price "$4.99–$24.99" below the product short description "Seriously. Drink a cup of this..." NSFW Image Below ( Adult Language ) Any ideas how to do this? I already have a ...
Kane's user avatar
  • 291
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
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
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
16 votes
4 answers
6k views

How to move the sidebar in TwentyFifteen to the right?

Is it possible to move the sidebar in the TwentyFifteen theme to the right using a child theme and CSS only, or does it require changes to the theme itself? The main issue I'm running into is that I ...
Anteru's user avatar
  • 271
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
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,994
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
14 votes
3 answers
49k views

how do I queue my Child stylesheet/s *after* every Parent stylesheet/statement?

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 ...
Gregory's user avatar
  • 569
14 votes
2 answers
7k views

how can I add an icon/image for a child theme?

I have set up a child theme of the twentyten theme. In the themes section that under the appearance, I can only see the child theme's title, author name, and a grey box above it. How can I add an ...
Lisha's user avatar
  • 145
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
13 votes
4 answers
14k views

How to cache bust a child theme style.css

There may be several aspects to my question but I feel in essence it's easy: how do you make sure changes to a child theme style.css are properly propagated across caches? I read in a few places that ...
Marcel Stör's user avatar
12 votes
2 answers
38k views

Override get_template_directory() in child theme?

Is it possible to replace a get_template_directory() in my child's functions.php file? I want to make changes to the file: /** * Load Custom Post types file. */ require get_template_directory() . '/...
Heather's user avatar
  • 479
12 votes
4 answers
25k views

Childs PHP files not overwriting Parent's PHP files

I have a php file located at: .../wp-content/themes/kallyas-child/pagebuilder/elements/TH_TeamBox/TH_TeamBox.php I'm trying to use the above file to overwrite the parent's TH_TeamBox.php file which ...
domdambrogia's user avatar
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
11 votes
2 answers
42k views

Adding javascript to child theme

I want to apply some javascript to my header and want to know what the best way to implement it is. here is the source that contains the javascript I'm including - https://codepen.io/kaemak/pen/mHyKa/...
Jordan 's user avatar
  • 111
11 votes
4 answers
34k views

Child themes CSS priority problems without using !important

I changed my WordPress site to use child themes, but the parent theme style has priority over any change I make on the child theme CSS. I can work around it using !important, however this is a patchy ...
Dharkov's user avatar
  • 113
11 votes
4 answers
30k views

Overriding Plugin Template Files with Child Theme

So hopefully a simple question. I have a child theme installed and have been able to successfully override changes to a .php file that is held in my theme files by uploading it to my child theme. If ...
Jacob Jordan's user avatar
10 votes
3 answers
2k views

Starter Theme vs Parent Theme? Pros and cons

I'm building a theme to be used as an example for other websites for the company I'm working. In another project we used the Hybrid Parent Theme and was really easy to build, but REALLY hard to ...
romulodl's user avatar
  • 171
10 votes
2 answers
40k views

How to set thumbnail image for a (child) theme

I've created a basic child image for twentytwelve, and it works as expected. The only issue is that it does not have a thumbnail image in the themes page: How do I set a thumbnail image for my child ...
Adam Matan's user avatar
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
10 votes
3 answers
143k views

WooCommerce shop page to use my custom template [closed]

Before asking the question I want to tell you that I have already asked the question in https://stackoverflow.com/questions/15025213/wordpress-woocommerce-template-file-overiding I am using the ...
NewUser's user avatar
  • 181
9 votes
8 answers
46k views

Include files in child theme functions file

Typically in my theme function file I'll require other files to keep things neat. require_once("foo.php"); Now working in a child theme I'd like to do that same. I'm adding custom admin options and ...
curtismchale's user avatar
  • 2,599
9 votes
2 answers
6k views

Is a text-domain necessary for a child theme

Sorry for the noob question. Is a text-domain necessary for a child theme? I am building a simple child theme with no text-domain declared. So, when I use strings which are to be translated, should I ...
Ayanize's user avatar
  • 237
9 votes
1 answer
11k views

How to modify single.php in a child theme?

My WordPress site uses a child-theme (of the default twenty-sixteen) and now I would like to insert a new line into the single.php file. I know that it's better to use the functions.php file of the ...
user avatar
9 votes
5 answers
18k views

Cannot get Child Theme to load latest version of style.css

I'm using a Child theme set up correctly. But I just cannot get changes in the Child theme style.css to be reflected in the site. Tried emptying the browser cache a million times and it doesn't work! ...
user1199360's user avatar
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
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
8 votes
4 answers
14k views

@package & @subpackage: how to use with child themes

My problem is with @package and @subpackage. I went to the suggested link (What are the package and subpackage comment for?). There I did not find anything I could apply to my problem but instead ...
Marie's user avatar
  • 81
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
7 votes
3 answers
28k views

My child theme doesn't work Error: "The parent theme is missing. Please install your parent theme"

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 ...
Hkoh's user avatar
  • 109
7 votes
2 answers
14k views

Redeclare a function in a child theme

I want to redeclare a function that I inherited from the parent theme. When I do it in functions.php, I get a fatal error that redeclaration is not possible. I did a workaround: creating a modified ...
Gergely's user avatar
  • 219
7 votes
3 answers
34k views

Why is the Child Theme Stylesheet Not Loading?

I'm using the HashOne theme and created a child theme in order to make various color changes to our website. However, the changes I've made to the child theme stylesheet are only taking place in the ...
Sakena's user avatar
  • 73
7 votes
2 answers
3k views

Do Child-Themes automatically load the Translation from the Parent-Theme?

Is it enough to just create a child-theme - let's say technically without adding anything else but the bare minimum style.css - to have the translation of the parent-theme being used automatically for ...
hakre's user avatar
  • 12.9k
7 votes
1 answer
4k views

Hiding Parent Theme

I am using the child theme and have renamed it to the new theme name. However, the parent theme is still viewable in the admin area with the original theme name. How do I hide the parent theme? Thanks....
kayzoe01's user avatar
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
3 answers
4k views

Child Theme vs Duplicate Theme Renamed

Okay, I quite often see people talk about child themes and the reasons for using them instead of modifying the existing theme, but they all seem to center around the idea that if the parent theme is ...
SickHippie's user avatar
  • 3,085

1
2 3 4 5
25