0

under Settings->Reading I can set which page should appear immediately when visiting my site as "home-page".

In my case I want the archive of my custom-post-type named "events" as home/front-page of my site.

So I have a hardcoded item in my navigation that says "Events" that links to /events and uses my custom-post-template to loop through my custom-post-type.

How could I (and what is the best way) set this archive as the automatic home/front-page of my site? I want to avoid unnessecary routing on my page. So when calling "www.mypage.com" I want the archive to appear immedeately.

Any ideas on that? Preferrably even as setting in my "Settings->Reading" section in the backend.

Thank you in advance. Matt

2

I would do this:

Create template and include events archive file

<?php
/*
  Template Name: Index Events
*/
get_template_part( 'category-events' );   // Archive for Events (category-events.php)
?>

Then create page using this template and finally select this page in Settings -> Reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.