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
0
votes
0answers
47 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 ...
0
votes
1answer
20 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 ...
0
votes
1answer
111 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 ...
1
vote
1answer
80 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. ...
2
votes
2answers
29 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 ...
0
votes
1answer
22 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; } ...
0
votes
1answer
15 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 ...
0
votes
0answers
215 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/ ...
0
votes
1answer
174 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 ...
0
votes
1answer
315 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 ...
0
votes
1answer
394 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 ...
1
vote
1answer
20 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 = ...
0
votes
1answer
21 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 ...
1
vote
1answer
169 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-...
1
vote
1answer
17 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://...
1
vote
0answers
21 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 ...
1
vote
1answer
46 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 ...
0
votes
1answer
11 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 ...
0
votes
1answer
124 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: ...
1
vote
0answers
64 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 ...
1
vote
0answers
24 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 ...
0
votes
3answers
43 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-...
0
votes
1answer
22 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 ...
-2
votes
1answer
47 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
80 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 ...
0
votes
1answer
33 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 ...
0
votes
1answer
103 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: ...
0
votes
0answers
61 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 ...
1
vote
3answers
184 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 ...
0
votes
2answers
27 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 ...
1
vote
2answers
712 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
0answers
137 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 ...
1
vote
1answer
28 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 ...
1
vote
1answer
27 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 ...
1
vote
2answers
400 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 ...
3
votes
2answers
535 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'...
0
votes
0answers
745 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 ...
0
votes
3answers
334 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 ...
0
votes
1answer
43 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 ...
0
votes
2answers
115 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: // ...
0
votes
1answer
435 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 ...
0
votes
1answer
76 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( ...
0
votes
2answers
229 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?
1
vote
1answer
45 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() ...
1
vote
2answers
371 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 ...
0
votes
0answers
138 views

How to work with a custom theme that someone else created before me? (details below)

A company hired me as a web designer. Their website was designed by a private company that created the WP website from scratch: they customized a theme, installed all the plugins needed back then, and ...
0
votes
2answers
23 views

Downloading customized theme from wordpress

I activated wordpress theme twenty twenty and make some changes in it like background color , change default contents and landing pages etc . Can I export this modified theme and import in another ...
0
votes
1answer
149 views

Wordpress core jquery version file not loaded?

I try to put a simple <textarea> with an emoji picker (https://github.com/mervick/emojionearea) in my wordpress site (with buddypress installed, actually I put this in buddypress messages). The ...
0
votes
1answer
19 views

Add back in child theme what the parent theme removed with remove_action

My parent theme removes the emoji fallback script that makes emoji show up as images: // parent theme's functions.php remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('...

1 2
3
4 5
24