Custom Post Type Archive Page

Hi

I’m trying to set up a custom post type archive page.

So far, I have archive-news-events.php in the root, which works fine, but I want to customise the loop.

base.php is as per the original file.

I’ve tried to copy templates/content.php to templates/content-news-events.php but after inserting some random text, I can’t see it appear anywhere, whereas text does appear if I insert it in templates/content.php

The custom post type is ‘News & Events’ with a slug of ‘news-events’

Any help would be appreciated.

Doug

The templates folder isn’t affected by the wrapper. You just need to make sure that your archive-news-events.php file correctly references your new content template:

<?php get_template_part('templates/content', 'news-events'); ?>

I think it may have to be

<?php get_template_part('templates/content-news', 'events'); ?>  
1 Like

Hi Guys

Thanks for the replies.

Both methods have worked perfectly. Thank you very much indeed.

Doug