[Resolved] Override generate_blog_single_featured_image

Home Forums Support [Resolved] Override generate_blog_single_featured_image

Home Forums Support Override generate_blog_single_featured_image

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #611802
    John

    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.

    GeneratePress 2.1.2
    GP Premium 1.6.2
    #611804
    John

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

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

    #611826
    David
    Staff
    Customer Support

    Glad to hear you found a solution.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.