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
-1 votes
1 answer
21 views

add_action works outside condition but not inside it

I am developing a theme framework for my own purposes. So this time i am facing a problem, that is add_action works out side conditional. add_action( 'meanz_before_main_wrap', '...
Raashid Din's user avatar
0 votes
0 answers
623 views

PHP “warning include_once(): Failed to open stream” Simple HTML DOM in Wordpress Child Theme

I am trying to include SIMPLE_HTML_DOM Library for my WordPress site. Unfortunately I get an warning. Below is my file tree in child theme include_once(): Failed opening '/var/www/html/wp-content/...
George Alvis's user avatar
0 votes
0 answers
386 views

Wordpress Staging site is redirecting to live and lost the child theme

I had a staging version for a WordPress site that contained a child theme as the main one, and everything was working well. After a few weeks, the staging site suddenly keeps redirecting to the live ...
Majed Badawi's user avatar
0 votes
2 answers
205 views

Browser stacks different versions of style.css

I am working with a child theme from 'Astra'. I am editing 'style.css' of my child theme for styling my website. I added this code to my child's functions.php' file to enqueue the father-child styles. ...
David Sarrà's user avatar
0 votes
0 answers
168 views

Theme functions don't work as expected in partial included via get_template_part() after custom query using Ajax [duplicate]

I am developing an custom theme which could be a child theme of any arbitrary theme out there that has custom theme functions defined. The home page is simply configured as list of latest posts. I ...
Dropbear's user avatar
0 votes
1 answer
33 views

Understanding the child / parent theme relationship

I am looking to edit the header.php file on my website. My parent theme has a header.php file. I copied that file to my child theme and added the necessary code. It seems to be working. My question ...
Vonedaddy's user avatar
0 votes
1 answer
281 views

What's a good way to allow overwriting files within a child theme if I want the same folder structure?

My parent theme has a structure like this Core\Utilities\Gallery.php. It's in the namespace of Product\Theme\Core and the file is loaded using composer's autoload. I thought to myself, I have a great ...
Daniel Simmons's user avatar
1 vote
1 answer
250 views

the file placed in the child theme is not included

I have modified the theme.php file located in the parent theme in the "Includes" folder, and I have placed it in the child theme also in the "Includes" folder, but my changes are not included. ...
reti's user avatar
  • 27
2 votes
2 answers
104 views

How can I & how do I change text displayed in comment via child theme

This isn't a specific theme I'm asking for, well, yes it is, but I assume the answer would work on any theme.. I've recently learned little about child theme, but I'm not understanding how to change ...
JoBe's user avatar
  • 171
0 votes
1 answer
35 views

How Do I Unhook This Parent Theme Function?

In a parent theme I have a function like this, that removes hyperlinks from comments: function preprocess_comment_remove_url( $commentdata ) { //some code... return $commentdata; } ...
TheKidsWantDjent's user avatar
0 votes
1 answer
20 views

Is there another way to customize a parent template file besides adding the file to a child theme?

In the 10+ years that I have been working with WordPress child themes, I have never seen a problem with a template file being copied into a child theme and customized, until now. There were function ...
Nora McDougall-Collins's user avatar
0 votes
0 answers
849 views

Best way to edit/change comment-template.php without changing the core

I've been modifying the include/comment-temple.php file, and since that modification will vanish upon updates Is there anyway to just simply copy the comment-template.php file from the included/ ...
JoBe's user avatar
  • 171
0 votes
1 answer
352 views

Swap SVG icons in child themes

The Twenty Nineteen theme uses inline SVG for its icons instead of icon fonts. The icons are added to the HTML code with the TwentyNineteen_SVG_Icons::get_svg() function. public static function ...
leemon's user avatar
  • 1,806
0 votes
1 answer
801 views

WordPress filter load_textdomain_mofile not working inside a child theme's functions.php but works form inside a plugin

Function in a plugin is behaving differently than function in the functions.php inside a child theme. I have a custom simple plain plugin with nothing but the following code in it and it works ...
Mike's user avatar
  • 121
1 vote
2 answers
2k views

How to load parent theme template parts in child theme

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 ...
Yusuf Been Hashem's user avatar
1 vote
1 answer
61 views

Child them function.php 'parent-style': should I name this as parent theme name?

When creating child them and setting up the initial function.php content: <?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { $parent_style = ...
Robert Brax's user avatar
0 votes
1 answer
36 views

Copying a modified theme from one wordpress site to another wordpress site [closed]

So, I have one website which was using a theme called "theme-xyz". In past, I directly made modifications to this theme, in header, footer and style. Now, I want to copy this modified theme to a new ...
WiData's user avatar
  • 3
1 vote
1 answer
348 views

changing parent theme into child theme

I inherited a site that didn't use a child theme, and now it needs to be updated. Can I take the original parent theme, change the style sheet header, copy it into the root, delete everything but wp-...
plushjudy's user avatar
1 vote
1 answer
25 views

How do I call in a category title on a category page in a child theme?

I would like to pull in the Category Title as an H1 tag, but I don't know if it is possible to do without modifying the Parent Theme. For example I would like the category for this page [https://...
user2510408's user avatar
1 vote
0 answers
49 views

Is it possible to add a ribbon in the background of h1 on every page?

I want to customize my h1 and to put a ribbon in the background like in the example bellow. Example: https://css-tricks.com/snippets/css/ribbon/ I'm not quite sure if/how it's possible to make all ...
Cris J's user avatar
  • 11
1 vote
1 answer
233 views

Create a post in custom post type using field in registration form after users submit form

As part of this project i have already created an Institute custom post type which i can see in the admin dashboard. What i want to do now is link it to the registration form. The logic is that when ...
junior's user avatar
  • 21
0 votes
1 answer
13 views

Widget is displayed in two places

I want to add a widget below page content in my child theme. I used a function from here: https://codex.wordpress.org/Widgetizing_Themes and the widget is displayed where I want: but it is also ...
maja's user avatar
  • 1
0 votes
1 answer
224 views

Started getting warning message following host's PHP upgrade

I am using a child theme of TwentyTwelve (the customer is always right). I recently started getting the following warning bot at the top of the Dashboard and on the Jetpack panel of the Dashboard: ...
Martyn's user avatar
  • 1
1 vote
0 answers
147 views

How to filter, restrict and return posts based on custom user meta information

On this online platform project i have requested all users to add in their school title. In the user dashboard there is a posts section which currently shows all posts. I want to only show posts that ...
Junior92's user avatar
1 vote
0 answers
41 views

How to first edit in local Wordpress editor on page and the add code?

I started a local WordPress site using DesktopServer. (Atom for coding). And I want to start creating the new website by first creating a "page" in local WordPress and creating a basic layout, and ...
Jesper's user avatar
  • 11
0 votes
3 answers
49 views

Overrite parent functions using child functions

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-...
DevSem's user avatar
  • 209
0 votes
1 answer
99 views

How can I access variables from theme in child theme? [closed]

I am using a WordPress theme (Kalium Theme) as a base and extending it with my own child theme, which includes javascript & php files. The parent theme uses a image carousel plugin (Flickity) to ...
hjXPYk22's user avatar
-2 votes
1 answer
102 views

Can't modify plugin function

Is there any possible way that could help me overwrite or redeclare a function inside a plugin? I tried to create a folder with its name inside the child theme, but it did nothing. The original path ...
mocimas's user avatar
0 votes
1 answer
182 views

Getting a list of the PHP files included to generate a page

Some commercial themes have become a real mess: the header may be created by the files in the theme folder or by child theme or maybe from a legacy folder which is located inside a legacy plugin. In ...
Revious's user avatar
  • 313
0 votes
1 answer
151 views

How to fix error message to edit sidebar widget text on a livesite childtheme?

My WordPress livesite says "An error has occurred. Please reload the page and try again" when I try to edit the sidebar widget text of a twentysixteen child theme. I copied the website to localhost ...
Antoine Alfawdaa's user avatar
0 votes
1 answer
42 views

How do I check or test a WordPress Auto Year Change Script?

How can you test a WordPress copyright year that is generated dynamically or through PHP, meaning when the year changes without waiting an entire year to see if it changes? I do not know anything ...
Marc Striebeck's user avatar
0 votes
1 answer
274 views

Why <?php echo get_template_directory_uri() ?> still output /wp-content/themes/twentynineteen?

I've developed some twentynineteen-child template. Today, I need to convert my last child-template into a template stand-alone. I removed the following line from the style.css file: Template: ...
Rémi B. LOIZEAU's user avatar
0 votes
0 answers
157 views

How can i add product Accessories from front-end using custom php form?

I have a custom HTML form I am saving the product data using WordPress-Woocommerce functions. I am able to save all the product details but getting issue in saving Product Accessories ( please check ...
Gaurav Chauhan's user avatar
1 vote
3 answers
441 views

Reusable functions and tools (Framework)

I do have a few PHP custom functions that I use almost every time on my applications. Those functions are not all related to WordPress, but some are and thus need that WP is initialized before I can ...
Tim's user avatar
  • 516
0 votes
2 answers
37 views

Can I create a child theme from a premium theme without losing my posts and page etc that I already have?

I have a Wordpress installation with the theme premium, in case I created a custom page to be used, however as this site was already in production I ended up following it that way, even though I know ...
José Roberto Oliveira's user avatar
1 vote
2 answers
2k views

Add head and body function for google tag manager in child theme

I've got a child theme activated and I don't see any head and body in my child theme to place the GTM snippet. How do I do this? I rather not paste in the whole head and body in the child theme to ...
Mikkel Damsgaard's user avatar
0 votes
0 answers
167 views

twentysixteen child theme - responsive menu - ham icon button not working - Cannot read property 'classList' of null

I am trying to convert this site http://buildandtest.atspace.cc/ into twentysixteen child theme. It appears that /js/menu.js in my child theme is not working as nothing happens when the ham icon ...
810311's user avatar
  • 41
1 vote
1 answer
51 views

Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox

I succeed in creating a metabox with custom field inside, and I restrict it to appear in a custom post type. //define metabox function product_info_en() { add_meta_box( 'english_info', 'English ...
adrian li's user avatar
  • 143
1 vote
1 answer
59 views

Which action is triggered when a theme was modified?

I want to intercept plugin changes, but no action hook listed in the Action Reference seems to do it. I tried after_switch_theme which is triggered only after changing from one theme to another, and ...
Ingo Steinke's user avatar
2 votes
2 answers
1k views

Override the core function locate_template

I would like to override the Wordpress core function locate_template(). I want the function to also search an additinal plugin directory for a template file. I don't see any filters inside the ...
FamousWolluf's user avatar
3 votes
3 answers
2k views

Add colors to existing color palette without replacing it

Using add_theme_support( 'editor-color-palette' ) one can replace the color palette in the Gutenberg editor by a custom one: add_theme_support( 'editor-color-palette', array( array( 'name'...
leemon's user avatar
  • 1,806
0 votes
0 answers
1k views

Auto generate excerpt from ACF field on a CPT that does not support excerpt or content

I have a CPT which contains only 4 wysiwyg fields created with ACF. The CPT does not support standard WP excerpt or content fields. I would like the CPT to generate an excerpt automatically from one ...
mike_temby's user avatar
0 votes
4 answers
2k views

Enqueue custom css file on specific page

So I've been messing with this for a while now and I don't understand how I'm unable to pull in my style file properly by registering and calling it at all. Here is my method: public static function ...
user avatar
0 votes
1 answer
63 views

Use custom template on custom post type

So I'm kinda stuck on something that I'm trying to achieve and unsure how to even target it, so below I will explain all that I have and what I have tried. So I'm using the Genesis Framework and a ...
user avatar
0 votes
2 answers
233 views

Custom Background by Page IDs

I use TwentyTwent theme and want to change its background colour by page IDs. I'm not sure but when I check the functions.php, I see below lines which are related to background colours: // ...
Serdar Koçak's user avatar
1 vote
1 answer
1k views

How can I override a require() used in functions.php of parent theme to my child theme

I have created a child theme for a Theme, Every thing works fine, except there are some files being required in functions.php of parent theme which I want to override it from the child theme. They ...
Javed Akhtar's user avatar
0 votes
1 answer
91 views

Genesis Child Theme - Customize body

So I created a custom post type and I've also created a custom page called page-profile.php that follows the WordPress templating. Here is the code inside page-profile.php: <?php $args = array( ...
user avatar
0 votes
2 answers
941 views

How to display home page last modified date in anywhere of wordpress theme?

i just display my recent published and modified posts in homepage (index.php). how can i display last modified date of my home page?
Jax's user avatar
  • 11
1 vote
1 answer
189 views

Avoid loading css from parent theme

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() ....
Filip Witkowski's user avatar
1 vote
2 answers
1k views

Child theme style.css versioning

I've been breaking my head on this one. I have a child theme and made changes to the style.css document. These changes did not show up in the reload of the page because there is no mention of version ...
kls's user avatar
  • 21

1 2 3
4
5
25