Hi,
How can I set archive as my homepage? I am using GereratePress as theme, I look at Setting-> Reading. there is no option to set archive as homepage, same as theme setting.
Hi,
Thank you for contacting us and I'd be happy to assist.
To use the archive as the homepage, you'll need to make sure of these two points:
1. No static page is selected as a "Homepage" in the reading settings.
( example screenshot: hidden link )
2. In the target, WordPress Archive's "Loop Selection" settings, the "Home/Blog" option is selected.
( example screenshot: hidden link )
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!
I do what you said, my homepage is set, but all the post isn't shown. see the difference before and after.
Hi,
Thank you for sharing those screenshots.
I tried to log in using the admin access details from the previous ticket, it seems that the password has been changed.
Can you please share updated temporary admin login details along with your permission to set WordPress archive as the homepage again, to troubleshoot the missing posts?
( currently a static front page is set )
Note: I've set your next reply as private.
regards,
Waqar
Hi,
Thank you for waiting, while I performed some testing and research around this requirement.
By default, the WordPress homepage's loop query only brings in the "Posts" and not any other custom post types.
To show the "Unwraps" type posts on the homepage, using the WordPress Archive "Archive for Unwrap", you can include the following code, in the active theme's "functions.php" file:
function custom_post_type_in_home_loop( $query ) {
if ( is_home() && $query->is_main_query() )
$query->set( 'post_type', array( 'unwrap') );
return $query;
}
add_filter( 'pre_get_posts', 'custom_post_type_in_home_loop' );
This will force the homepage's loop query to bring in the "Unwraps" type posts.
Another alternative is that instead of assigning a WordPress Archive, to your homepage, you can set a static front page, and inside it insert a post view that shows the "Unwraps" type posts.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
To your first solution by adding the code into function.php, this will cause the page losing the filter in archive. I searched another thread https://toolset.com/forums/topic/how-to-set-up-archives-for-custom-post-as-homepage/, it mentions there is no easy way to do it. I will give up on this issue.