I have created an archive with Toolset for the Home page. I want the home page archive to show my custom posts too. But it is only showing the posts. How can I show the custom posts too in my home page archive?
It is not possible to add extra post types to the blog archive from within the UI, you need to overwrite the default setting of post with code, using the standard WordPress hook pre_get_posts (https://developer.wordpress.org/reference/hooks/pre_get_posts/).
Here's an example of the kind of code you would require (you can add a code snippet at Toolset > Settings > Custom Code; this snippet doesn't need to run on the back end):
add_action( 'pre_get_posts', 'ts_mod_blog_archive' );
function ts_mod_blog_archive( $query ){
if ( $query->is_home() && $query->is_main_query() )
{
// pass an array of post type slugs to include on blog archive
$query->set( 'post_type', array( 'post', 'thing' ) );
}
}
You need to edit the array to include the slugs of the post types you would like to include in the blog archive.