Overwrite template-tags.php in child theme

In functions.php child theme include template-tags.php from parent theme: require_once get_theme_file_path( ‘../parent-theme/inc/template-tags.php’ ); In the child theme template-tags.php remove parent action and add the child action replacing it: remove_action( ‘tag’, ‘parent-function’, 0 ); add_action( ‘tag’, ‘new-child-function’, 10 );

Using wp config to connect to a DB from a plugin

I’m guessing this is a custom “plugin” where you are wanting to run a file externally that connects to the WordPress database, not really as a standard plugin which loads within WordPress environment, as in that case as @belinus says you can just use $wpdb class. Anyway, since ABSPATH is defined IN wp-config.php, you can’t … Read more

Class property not visible inside ajax callback function?

Have you used AJAX before? Do you know what the acronym stands for? Hint: The J stands for javascript. Indeed, AJAX is usually invoked using javascript/jQuery. I believe that’s why you’re not receiving a response: you aren’t invoking an AJAX protocol or going through WordPress’s admin-ajax.php. And, why would you put a callback function in … Read more