[Support request] Custom Post Type Archive as Home Page

Home Forums Support [Support request] Custom Post Type Archive as Home Page

Home Forums Support Custom Post Type Archive as Home Page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2216151
    Matt

    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

    #2216161
    David
    Staff
    Customer Support

    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.

    #2216167
    Matt

    Hi,

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

    Thanks

    #2216175
    David
    Staff
    Customer Support

    Options are:

    1. create your own custom front-page.php with a loop for displaying the video posts…. bit of a ballache.
    2. Use a static page and in the near future use GenerateBlocks 1.5 to add the loop:

    https://generateblocks.com/generateblocks-1-5-dynamic-data-query-loops-image-blocks/

    #2216178
    Matt

    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

    #2216196
    David
    Staff
    Customer Support

    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,

    #2216202
    Matt

    Thanks.. Much appreciated!

    #2216206
    David
    Staff
    Customer Support

    You’re welcome – if the above works then i would be super glad to hear about it 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.