Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    Hi,

    The plugin supports custom post types.

    I’m not clear as to what exactly you’d like to implement with the custom post type in the widget.

    Are you talking about restricting posts by custom post type only?

    Thread Starter whoaloic

    (@whoaloic)

    Hi,
    I use restrict widget plugin and I would like to use related posts widget per custom post archive.

    By example, I’d like the widget be used in archive-posttype1.php.
    In this archive page, I would display widget related posts for postype1.

    Then, I’d like the widget be used in archive-posttype2.php.
    In this archive page, I would display widget related posts for postype1.

    Plugin Author Ajay

    (@ajay)

    Could you try adding this function to your themes function.php

    function filter_crp_custom_posts( $where ) {
      global $wpdb, $post, $crp_settings;
      $post_type = get_post_type( $post );
      return $where . "
        AND $wpdb->posts.post_type = $post_type
        ";
    
    }
    add_filter( 'crp_posts_where', 'filter_crp_custom_posts' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Choose custom post type in widget’ is closed to new replies.