• Resolved eguardlabs

    (@eguardlabs)


    I am using the yarpp plugin with custom posts types. I want to display 2 related post segments, 1. related products, 2. related reviews

    however when i use below, it will not filter only reviews

    related_posts(array(
    		'post_type' => array('review'),
    ));

    Same goes for the related products, it just shows two times the same related products

    I am using CPT UI for creating the the custom posts, and i have added “yarpp” as custom support as per their documentation. What am i missing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Michael Nelson

    (@mnelson4)

    HI @eguardlabs, you almost got it!
    You should just use yarpp_related function instead. related_posts overwrites whatever you pass in for post_type with whatever’s configured on the YARPP settings page.
    Eg this code snippet shows the related posts then related pages:

    
    <h1>Posts</h1>
    <?php
    yarpp_related(
        array(
                'post_type' => array('post')
        )
    );
    ?>
    <h1>Pages</h1>
    
    <?php
    yarpp_related(
    	array(
    		'post_type' => array('page')
    	)
    );
    ?>
    

    Does that help?

    Thread Starter eguardlabs

    (@eguardlabs)

    Thanks! Case closed! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom post filter not working’ is closed to new replies.