Getting one child function to supercede only the one parent function
-
I want to have a child theme supersede a parent function without replicating the entire parent php file and all the other functions it contains.
Example:
Parent has the function that needs modification in /inc/template-tags.php
Template-tags.php contains many functions. Only one (I’ll call it “post_date_and_byline”) needs a tweak (trying not to show the date and author of a post).Scenario:
If the theme is updated, I want my tweak to affect only that particular function in the template-tags.php file and none of the others that might be updated.Right now, the child functions.php has
require_once( get_stylesheet_directory(). ‘/inc/template-tags.php’ );The child’s template-tags.php is identical to the parent except the change in the one function.
The topic ‘Getting one child function to supercede only the one parent function’ is closed to new replies.