• Resolved TheDani

    (@thedani)


    Hey, how can I use do_action( 'hestia_blog_related_posts' ); on my custom post types?

Viewing 1 replies (of 1 total)
  • Hi @thedani,

    Thank you for using Hestia theme.

    If you’re looking to use this hook on your custom post types, you’ll need to add your custom code to the theme’s functions.php file or your custom plugin. Here’s a basic example:

    function custom_related_posts_for_custom_post_types() {
        // Your custom code here
        // This will be executed when 'hestia_blog_related_posts' hook is called
    }
    add_action( 'hestia_blog_related_posts', 'custom_related_posts_for_custom_post_types' );
    

    Replace the comment // Your custom code here with the logic you want to execute for related posts on your custom post types.

    Remember, using hooks and actions requires a good understanding of the WordPress plugin/theme architecture. If you’re not familiar with this, I recommend checking out the WordPress Codex or developer documentation to get a better grasp of how actions and hooks work in WordPress.

Viewing 1 replies (of 1 total)
  • The topic ‘related_posts with custom’ is closed to new replies.