Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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