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 functions.php so when/if the theme is updated, I don't need to redo everything. I've tried many things but none of them work. I wonder if the problem is where the snippets are placed by using a plugin or that the HTML element …
Category: Web

Child Theme not overwriting Parent theme php file

I'm new to Wordpress and how Child themes work. My child theme I am trying to overwrite two files in sub-directories. I've copied the parent files and edited them in child theme but changes are not reflected in parent theme. I'm trying to change the code for feature image sizes. I successfully changed the code in parent to test it and it works. But child theme isn't overriding it. /public_html/wp-content/themes/sahifa/framework/functions/theme-functions.php /public_html/wp-content/themes/sahifa-child/framework/functions/theme-functions.php /public_html/wp-content/themes/sahifa/framework/parts/related-posts.php /public_html/wp-content/themes/sahifa-child/framework/parts/related-posts.php Other question I had was do I …
Category: Web

Recommended way to load / enqueue parent and child stylesheet to enable cache busting

After reading several posts here (including [1] and [2]) and testing with Wordpress 4.5.3 using Twenty Sixteen as parent theme, I think the following (in functions.php) code must be correct: function childtheme_enqueue_styles() { $parent_style = 'twentysixteen-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'childtheme-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles' ); It loads the parent stylesheet (with parent theme version number) and then the child theme stylesheet (with child theme version number). This seems …
Category: Web

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 Translation is working fine everywhere except on themes provided templates like the search results page content or pagination. Affected are the SRP title, nothing found page title and nothing found page content. They just stay in default english language. Pagination is affected too. The search form in the content …
Category: Web

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 child theme. I added the folder with the modified mo and po files in the child theme with the same folder name as in the parent theme but this is not working. How can I come about this? …
Category: Web

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 the normal Dokan templates folder: wp-content/plugins/dokan-pro/templates/path-to-file.php by using wp-content/themes/theme-child/dokan/path-to-file.php However, because the file I wish to override is in the includes folder, I'm having trouble finding the correct file path to override the verification-new.php file. Any ideas? P.S. The reason why I wish to override the file in a child theme rather than simply edit the original is so I can …
Category: Web

Why is my child theme style.css not found (404) in the front-end?

I have a brand new Wordpress install (5.9.3) served by nginx (1.13.12). I'm using Docker containers for nginx and wordpress. I created a child theme based on twentytwentytwo following the WP codex instructions. It shows in the wp-admin and I was able to activate it and customize it through the block Editor. Now I want to add a css class to my style.css. Here's the function to enqueue my child-theme's styles : add_action( 'wp_enqueue_scripts', 'chesnaie_styles' ); function chesnaie_styles() { $parenthandle …
Category: Web

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 in the child theme function... this is the only script currently in child function. function prpin_scripts_child_theme_scripts() { wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' ); } add_action( 'wp_enqueue_scripts', 'prpin_scripts_child_theme_scripts' ); I thought functions like that are inherited from parent. Any advice?
Category: Web

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 file and that function is called on functions.php: add_action( 'page_widgets', 'footer_content_widget_area' );
Category: Web

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 example, if I add category.php or archive.php, I get a white screen of death, and this is the error I get in Apache: [:error] [pid 2919] [client 98.24.106.38:64974] PHP Warning: include(): Failed opening '/home/www-dev/beokinawa/wp-content/themes/x-child/index.php' for inclusion (include_path='.:/usr/share/php') in /home/www-dev/beokinawa/wp- includes/template-loader.php on line 74, referer: http://dev.bluepresley.com/beokinawa/wp-admin/edit-tags.php?taxonomy=category Whenever I …
Category: Web

Changing update message from Newspaper child theme

Maybe my question is very particular and limited to Newspaper theme users. I’m using child theme with an update server. It works fine. I’m wondering if I can change this update message and actions just for the child theme: Wanna do this because when I hit the Update button it actually updates the parent theme instead. I don't know if this can actually be changed from child theme or custom plugins. This message only appears under /wp-admin/themes.php I’ve tried coding …
Category: Web

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. So, I've put all the code into a separate file, in the base directory of the child theme, and tried to require it from within the child theme's functions.php. However, now it doesn't seem to work, or get registered, at all. After several hours …
Category: Web

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 error 404!) I try to delete custo menu style but nothig resolve. I try to delete the function about wpml but nothing resolve. //WPML Custom add_filter( 'genesis_nav_items' , 'flags_selector' , 10 , 2 ); add_filter( 'wp_nav_menu_items' , 'flags_selector' , …
Category: Web

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 the the_category(); function only returns a link. I also don't want it as a list. Any thoughts on how I can just get the "slug" of the category?
Category: Web

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>' ); ?> But that displays my titles as "Category: Category Title" instead of simply the title without the prepended "Category: ". My first instinct was to override get_the_archive_title() from wp-includes/general-template. But from what I've read, apparently I'm not supposed to ever alter wordpress core stuff, even with overrides from a child theme. So what is the best-practice …
Category: Web

Do not show one specific widget on one specific page

Using a child theme of genesis and am unsure of how to remove a contact us widget in sidebar from the contact us page. Is there an easy way to do so? It's part of the theme which has it on the side so when I remove this widget from one page it's removing it from all of the pages. I'm using News Pro Theme (child of Genesis) and am unsure of where to edit this in the template files. …
Category: Web

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 convert 99.9% of the theme over to a child successfully however for some reason I cannot move one solitary js file (main.js) to my child assets folder. Images, style sheets , fonts etc.. have all been transferred to the child theme successfully however If I …
Category: Web

Divi change project category slug

How to change taxonomy urls in wordpress? Following along with this question and this one But can not get the desired outcome. The default is: example.com/project_category/%category%/ What I want is: example.com/stainless-steel-products/%category%/ I have changed the slug of the project archive so that example.com/stainless-steel-products/ is the project archive. Below is the code used to achieve that. // Change peralinks projects function custom_project_slug () { return array( 'feeds' => true, 'slug' => 'stainless-steel-products', 'with_front' => false, ); } add_filter( 'et_project_posttype_rewrite_args', 'custom_project_slug' ); …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.