• Hi Support, the Blogs has a Related Posts. I made a Custom Post for Fundraising, can you give me a snippet to show Related Fundraising Posts based from category. Thanks.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter alonagomez

    (@alonagomez)

    Just an update, I used a plugin to show Related Posts on custom post. I hope you can provide a snippet so that I can uninstall the plugin.

    Hi @alonagomez,

    Please try the following snippet

    add_filter( 'astra_related_posts_supported_post_types', 'ast_add_related_posts_cpt_support' );
    
    function ast_add_related_posts_cpt_support( $post_types ) {
        $post_types = array(
            'post',
            'my-cpt-1'
        );
        return $post_types;
    }

    You need to change the my-cpt-1 to your CPT, of course.

    I hope it helps.

    Kind regards,
    Herman ??

    Thread Starter alonagomez

    (@alonagomez)

    Thanks it worked but it shows all the custom posts. Can you add more code to show the same custom category.

    Hi @alonagomez,

    It will inherit from the Related Post section under Blog > Single Post section on the Customizer. There’s an option to show the Related Post by Categories or Tags.

    Further, I would like to let you know that, actually, customization/ custom code is something that we are not offering to support.

    Maybe there will be someone in the community who knows how to code, will share a thought here.

    Kind regards,
    Herman ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Related Custom Posts’ is closed to new replies.