Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author dFactory

    (@dfactory)

    Yes, it’s possible.

    You have to use pre_get_posts action hook to combine both post types on your index page.

    This should work:

    function df_combine_post_types( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set('post_type', array( 'post', 'news' ) );
        }
    }
    add_action( 'pre_get_posts', 'df_combine_post_types' );
    Thread Starter BenLinders

    (@benlinders)

    Thanks for your help!

    Where do I add this code, which file?

    Plugin Author dFactory

    (@dfactory)

    functions.php of your current theme

    Regards,
    Bartosz / dfactory team

    Thread Starter BenLinders

    (@benlinders)

    I added it to functions.php, but I see no difference.

    My news in https://www.benlinders.com/news/ doesn’t show up in the blog roll at https://www.benlinders.com/.

    I emptied my caches, no difference.

    Anything I can try to debug this?

    Ben Linders

    Thread Starter BenLinders

    (@benlinders)

    Apparently it took some time for the CDN to pick up the changes. News is now visible.

    Only problem is that the Mantra theme shows my posts in columns and news items do not have the column format. But I’ll figure that out.

    Thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show news items in blogroll’ is closed to new replies.