Three questions per post is not typical; however, as they may all be inter-related I’ll try to help step through each one in turn.
The first problem may be simple:
When I go to mysite.com/success-stories/, it’s using the default
archive.php template. However, I have created a template called
archive-successstories.php and it’s being totally ignored.
The use of the archive template is determined by the 'has_archve'
parameter in your register_post_type()
call, which you’ve added like so:
'has_archive' => 'success-stories'
However, per the Codex, 'has_archive'
is expected to be string/boolean
: i.e. true
or false
. Try this instead:
'has_archive' => true
Then, flush your rewrite rules by loading the Settings -> Permalinks
page.
Important note: The URL to display the CPT archive using archive-successstories.php
will be example.com/successstories
, not example.com/success-stories
. If you want to use the latter, you’ll need to pass a valid 'rewrite'
parameter to register_post_type()
. Note that 'rewrite'
, if not boolean
, must be an array, not a string.