Changing CPT slug and taxonomy already registered in parent theme

WordPress 4.5 introduced the functions unregister_post_type() and unregister_taxonomy(). You could deregister your post type respectively taxonomy and register them again with your custom settings. The post type is still named portfolio. You could rename it, but you would probably have to check your template files for references. add_action(‘init’, ‘wpse_247924_overwrite_theme_post_types’, 1000); function wpse_247924_overwrite_theme_post_types() { unregister_post_type( ‘portfolio’ … Read more

Customize file on inc folder on child theme

Although it is a bit old post, there are some possible solutions: For your specific problem, since the only difference I see from the original widget is that you do not need the “tab3” regarding the recent comments and since each div has its own id, you can easily put in your css something like: … Read more

Problems clearing cache

After more than a half of a day of battle, I found out that style.css has to be in direct subdirectory of a child theme. I had placed it under the /css/ folder together with other styles. That’s why WordPress couldn’t find PHP files… Weird thing is that this folder structure has worked when I … Read more

Child theme function.php causes fatal error

This is because the same function exists in the parent. archi_theme_setup() Since you are under the same namespace there will be a name collision — PHP cannot hold two functions with the same name. When you set the child theme as the active one child theme functions.php will load first and then the other one … Read more

How to edit/replace Parent functions.php function in Child Theme to add “Walker” class

Go to your functions.php in your child theme add this: function childtheme_override_tesseract_output_menu( $cont, $contClass, $location, $depth ) { //tesseract_output_menu function code modified as you wish here } In your parent theme functions.php, wrap the tesseract_output_menu function like this: if (function_exists(‘childtheme_override_tesseract_output_menu’)) { /** * run the child override */ function tesseract_output_menu() { childtheme_override_tesseract_output_menu(); } } else … Read more

Changing a Child theme’s name on MAMP localhost

Recommended Method You don’t have to change anything in the database. Follow these steps: Activate a default WordPress theme (e.g. twentyseventeen) – that is any theme other than the child theme you are going to rename. Rename your child Themes folder name and child theme’s name in style.css file. Now activate the child theme. That’s … Read more

Is There A WordPress Hook for Accessing Attachments for A Particular Page?

Here’s one way, out of many, where we use the the_content filter and loop through the get_attached_media( $type ) to construct the list of attached media. We can e.g. use $type=”image” for images or $type = null for all mime types. add_filter( ‘the_content’, function( $content ) { // Nothing to do – target single posts … Read more