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.

I have set up a Custom Post Type called "Portfolio". If I view the CPT's Archive page without adding any posts to it (/portfolio or /?post_type=portfolio), it returns a 404 page. Is there a way to show the archive page but personalize the message? Ie "there are currently no portfolio items here right now".

As soon as I add 1 post into the portfolio custom post type, the archive page loads fine.

Here are other posts that match my issue

http://wordpress.org/support/topic/empty-archives-returning-404

Custom Post Type Archives with 0 Posts Redirects as 404

share|improve this question
add comment

1 Answer 1

what have you set the "has_archive" option to in your CPT? Also, make sure to reset your permalinks.

As for putting a customized message, you can create an archive template specific to that CPT. If the CPT is "portfolio", then you can create a template called "archive-portfolio.php" and customize it as you see fit.

share|improve this answer
add comment

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.