Skip to main content

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 vote
2 answers
1k views

Add custom function to a theme with child theme's functions.php

I am using a theme Indigo and have it working fine, in a child theme configuration. I want to add a custom function. Unlike the child style.css, I have read that you don't need to import the parent ...
0 votes
3 answers
837 views

Why won't my Custom CSS Load

I'm in the process of adding a jQuery plugin to a site I'm working on. Needless to say it requires loading a custom script; also a custom stylesheet. Starting with the stylesheet I've been ...
0 votes
1 answer
2k views

How to override html codes in wordpress?

<article id="post-<?php the_ID(); ?>" <?php post_class( array('list-article', 'clearfix') ); ?>> <div class="list-article-thumb"> <a href="<?php echo esc_url( ...
1 vote
1 answer
46 views

Can't make an external api call in php side of wordpress child theme

Edited 07-14-24 to show permission callback in api Edit 2: showed my fatal error I'm new to making api calls in wordpress. I need to make an api call through the backend to a 3rd party api. I can't do ...
0 votes
1 answer
1k views

Fatal error: Cannot redeclare load_stylesheets() (previously declared in

Updated Question: I’ve declared a basic child theme. As I create a function to enqueue stylesheets, my website crashes and gives me a Fatal error: Cannot redeclare thando_stylesheets() (previously ...
0 votes
1 answer
25 views

Migrating a Bootstrap 3 Website to WordPress

I'm in the process of migrating a legacy Bootstrap 3 website with around 300 pages to WordPress. I'm planning to use GeneratePress as the theme and WPBakery Page Builder along with some additional ...
7 votes
2 answers
9k 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 ...
0 votes
2 answers
33 views

For a Child Theme, do I duplicate the parent style.css and then add my child css?

I'm creating and installing a child theme for the first time. There are only a few edits to the style.css and one to the functions.php file. Do I need to copy the entire parent style.css into the ...
0 votes
2 answers
2k views

Modifying child theme's header

I'm a noob. I have copied the header.php from the parent theme, I have added some snippets and things work. However, I would like to be able to add those same snippets either using a plugin or via ...
0 votes
2 answers
996 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?
0 votes
2 answers
4k views

Overwrite template-tags.php in child theme

I would like to overwrite some content which is located in (inc/) template-tags.php file on parent theme. Content need to be changed is in function footer_content_widget_area in template-tags.php ...
0 votes
1 answer
771 views

Include widget file in functions.php of child theme

I've created a widget for WP 5.9.3, based on an online tutorial, which I'd got working okay, but it relied on having all the code in the child theme's functions.php, which started looking a bit messy. ...
0 votes
0 answers
28 views

Twenty Twenty One update changes dom classes and breaks my child theme

I built my first child theme and am paying the price of my ignorance. It basically breaks all the time. Every update to the main theme (Twenty Twenty One) seems to change some class name that my js ...
0 votes
2 answers
1k views

Calling Category name without the link

I have looked to see if there is a simple function that only returns the name of a category on a post. I am looking to output it as a subheading for a list of posts but do not want it as a link and ...
0 votes
1 answer
965 views

Why would adding a template file to a child theme cause an error in template-loader.php?

Per wordpress best practices, I created a child theme for an existing theme I have. Everything works fine until I try to add a template file which follows WP's template hierarchy conventions. For ...
4 votes
2 answers
3k views

How do I override a parent theme's language files with a child theme?

I have a parent theme and a child theme, I would like to override the spanish .mo and .po files in the parent theme (or add them if they are not present in the parent theme) with the es_ES ones in my ...
0 votes
1 answer
859 views

Child theme is not rendering parent and own javascripts (but css loaded properly, js not)

I have a child theme and a quite empty function.php. The CSS from the parent is picked up by the child theme, but the whole JS section from the parent theme is not rendered in the DOM at all. (I am ...
1 vote
1 answer
1k views

Edited Child Theme's "header.php" but it doesn't appear to change the file

So I logged into FTP and navigated to /wp-content/themes/MyChildTheme/ and edited the header.php file. I saved the file and uploaded it and I can confirm the file has changed because if I check via ...
0 votes
2 answers
1k views

function of parent not working in childtheme

I have a plugin used on a parent theme which uses shortcode. The plugin (shortcode) works on the parent theme but when I switch to child theme it no longer works. I've only added the child theme code ...
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 ...
0 votes
1 answer
739 views

AJAX numerical pagination problem in TwentyFifteen-child theme

I want to create an AJAX numeric pagination. And found code in a website. And it works perfectly at first click event, but on the second click it doesn't. If I click in pagination page 4, it works ...
0 votes
1 answer
238 views

Why does using wp_register_style without wp_enqueue load and print CSS tags in the front-end?

I have this piece of code that registers a CSS in a child theme and when visiting the front-end my_css is actually included. Why is that ? I thought that registering meant registering for later use to ...
0 votes
0 answers
12 views

Live Preview while customizing is not showing the updates while editing in WordPress

I'm working on a small website in WordPress, when clicking the "customize" button, it will open a page that shows a "Live Preview" of the website and allows you to add custom CSS ...
0 votes
1 answer
710 views

How to add meta fields to custom taxonomy add/edit page?

I have a custom taxonomy 'issue'. I tried to add some meta fields to the add/edit issue pages in the dashboard using the method explained by Ohad Raz (https://en.bainternet.info/wordpress-taxonomies-...
0 votes
2 answers
3k views

How to override filter in child theme?

I'm trying to override a parent theme filter in a child theme; I must have the syntax wrong as the override is being completely ignored. Here's what's in my child theme's functions.php: //* remove ...
0 votes
1 answer
3k views

remove_action() hook not working

On my child theme, I created this: remove_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',20); add_action('woocommerce_single_product_summary', '...
1 vote
1 answer
27 views

Can't disable child theme style

I got problems with my twentytwenty child theme and hope, that someone can help me. In order to optimize my website for speed, I'd like to use critical css as inline code. To do that, I wanted to call ...
0 votes
1 answer
1k views

child index.php does not overwrite parent index.php in twenty fourteen theme

I am using the twenty fourteen theme to create a child theme and want to make changes to the index.php, but when I copy the index.php file to the child theme's directory and edit it, it doesn't change ...
2 votes
2 answers
2k views

How to set the background color of a template part (Header/Footer) in Twenty Twentythree?

In Wordpress's shiny new Twenty Twentythree theme, how can you assign a background color to the header or foother template parts? Can this be done in a child theme - through theme.json? Or somehow ...
0 votes
1 answer
1k views

Loading my main.js file from my child theme

I have built a child theme out from the original parent theme. Having on completion learnt that it is standard industry practice to build a child theme (preferably from the start.) I have managed to ...
1 vote
0 answers
25 views

Trying to insert widget code into theme function

The site I am working on has a function in the theme (Botiga) that creates a wrapper row that displays a sorting dropdown for the items below. The default output is the dropdown displays in the right ...
0 votes
1 answer
1k views

Pseudo class :before don't working in a specific button

Currently, i'm building an ecommerce and a small button was running with pseudo class :before suddenly stopped working.The site run WP with Divi and Woocomerce. I wish the bellow code back to run: ....
4 votes
1 answer
783 views

How to use parent theme's enqueue methods

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 ...
0 votes
1 answer
1k views

How to enqueue stylesheets in child-theme functions.php?

I know this topic is old hat, but I still got issues with that. I use the elementor child-theme and try to enqueue the following stylesheets hello-child-theme-folder: style.css hello-child-theme/...
0 votes
1 answer
79 views

Proper way to load styles using a child theme

I decided to start using Elementor Hello theme for building my websites. In the past, I always edited style, templates and other theme files directly from the original theme directory, but I decided ...
0 votes
0 answers
25 views

How to move custom icons from parent theme to the child theme

I have two sets of custom font icons that from my understanding are being loaded by two php files of the theme that i am making a child theme of : admin-style.php & icons.php admin-style.php : <...
0 votes
0 answers
20 views

Child theme's functions.php not being read (child theme's autoload.php not being run)

Our child theme's functions.php contains: require_once __DIR__ . '/vendor/autoload.php'; However, the files that autoload.php loads are not being loaded, and a fatal error occurs. '/vendor/autoload....
1 vote
1 answer
35 views

enqueue_custom_scripts isn't working

I am attempting to use javascript to activate hotpots I have made in Wordpress, (using HTML and CSS but when trying to enqueue my custom script. Nothing is happening. function ...
0 votes
3 answers
140 views

Wordpress child theme widget customization - Eduma

0 I'm in a bit of a struggle at the moment so I could use some help. The thing is, I need to fix some fields for registration in the Eduma theme Eduma theme has it's own child theme called Eduma-child,...
0 votes
2 answers
3k views

Where did my Theme Editor go?

I have 2 blogs, both are versions 3.x One of them, "Blog 1" is a multi-user blog. I can't edit the themes under Appearance->Editor , because it doesn't appear. "Blog 2" is a single instance blog, ...
0 votes
0 answers
57 views

ACF Pro simple Business Directory - Requesting assistance with created Templates and associated Functions.php Coding

I want to replicate the basic Business Directory functionality found at this URL. We've not had any luck with off-the-shelf software and our needs are very basic. https://onetopanga.com/directory This ...
0 votes
1 answer
344 views

How do I create a single.php file as the default template for single posts in the twentytwentythree theme?

I am trying to create a single.php file to be the default template for displaying single posts in a child theme that I have created from the TwentyTwentyThree theme. The reason I want to set this as ...
0 votes
1 answer
197 views

How to disable the autozoom on mouseover for the product image in Storefront theme of WooCommerce?

I'm currently using the WooCommerce plugin with the Storefront theme on my WordPress site. On the single product pages, the main product image has a default mouseover behavior that I want to modify. ...
0 votes
1 answer
677 views

Menu on responsive twentytwelve theme not working, strange url error

i use twenty twelve custom theme (palumariosrl.it) but i have a problem. If i try to use on responsive mode the menu not function (can i see only hover menu page and if i click on menu buttom i have a ...
13 votes
2 answers
40k 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() . '/...
0 votes
1 answer
28 views

Category theme template becomes default template for child theme

I am developing a child theme and have created a custom template for "category/ archives" page for a specific category However, For some reason this custom template has become the default ...
0 votes
1 answer
58 views

twentytwenty children theme, using gutenberg, changing a title change them all

I started to look forward modifying thèmes and i made a children theme from twentytwenty. On the landing page, using gutenberg, i edited page name at top, then added some paragraph, gallery and when ...
0 votes
3 answers
3k views

Override Dokan Includes File in Child Theme

I'm trying to override this Dokan plugin file in a child theme: wp-content/plugins/dokan-pro/includes/modules/vendor-verification/templates/verification-new.php I can successfully override files in ...
0 votes
0 answers
30 views

Confusion about theme's parent and child functions.php file

So I read WordPress documentation here: https://developer.wordpress.org/themes/basics/theme-functions/ Where there's such statement: Although the child theme’s functions.php is loaded by WordPress ...
0 votes
1 answer
26 views

Child Theme Reverts to Parent Theme After Activation: Customizations Lost

I'm experiencing an issue with my WordPress child theme. I created a child theme based on the 'drinkify-lite' parent theme and used the provided code to enqueue the parent styles in my child theme's ...

1
2 3 4 5
25