Site logo

Archived topic

Custom Post Type Archive as Home Page

7 replies · Started by Matt on May 11, 2022

Viewing posts 1–8 of 8

Hi Guys,

Just wondering what the recommended way is to allow me to make my custom post type archive page (videos) as the websites home page (as selected in settings > reading > homepage).

I want to be able to use the GP elements content templates to style my custom post type archive loop.

Thanks

Hi there,

will you still have regular posts on your site ? And if so how are they to be displayed ?

Might be handy if could also see the site.

Hi,

The site is still in dev. Yes I will still have regular posts. They will be displayed on a 'blog' page.

Thanks

Thx.

Can I confirm... if I go option 1, will I be able to or what do i need to include to use the GP Content templates to style the posts?

And is there a scheduled release date for the GB 1.5? I can see it is in Alpha but it might not be an option if you are still weeks or months away from a release.

Thanks

Option 1 - In theory yes...
If you want to try then this would be my approach:

1. copy the GP archive.php template as the basis for your front-page.php

2. Now you need a blank page for your Blog and another one for a Static Home Page. And set them accordingly in Settings > Reading. That should allow you to have a separate blog. And the front-page.php will override the static home page.

3. Then filter the front page so it shows just your custom post type with this snippet:

add_filter( 'pre_get_posts', function( $query ) {
if ( is_front_page() && $query->is_main_query() )
   $query->set( 'post_type', array( 'your_custom_post_type_here') );
   return $query;
});

Or create your own custom loop in the front-page template.

4. Create your Content Template and set its Display Rules to: Front Page

Thats the theory anyway :)

GB 1.5 - hard to give a definite timeline at this stage, as we're still in Alpha, i would like to think no more than 1 month,

Thanks.. Much appreciated!

You're welcome - if the above works then i would be super glad to hear about it :)

This archived topic is closed to new replies.