Site logo

Archived topic

Override generate_blog_single_featured_image

2 replies · Started by John on June 29, 2018

Viewing posts 1–3 of 3

Hi, I'm trying to override generate_blog_single_featured_image() in functions.php.

But it's causing a bit of trouble.

I've tried adding the following code:


add_action( 'init', 'remove_actions_parent_theme');

function remove_actions_parent_theme() {
	remove_action( 'generate_before_content', 'generate_blog_single_featured_image' );
	add_action( 'generate_before_content', 'custom_generate_blog_single_featured_image' );
};

but I just end up with 2 featured images, meaning it did not remove the action.

I've resolved the issue by using an action just after the initial hook from GP Premium.

add_action( 'wp', 'remove_actions_plugin', 51);

Glad to hear you found a solution.

This archived topic is closed to new replies.