I would suggest first adding a new file called
archive-beach_clean.php
to your themes root directory.
Then copy and paste all the code from that index file into it.
After, if you haven’t done so already, add this argument, 'has_archive' => true
, to the arguments array used in the register_post_type function and in the same array make sure rewrite
isn’t set to false.
Then go to the wordpress admin area Settings->Permanlinks and make sure Post name is selected and click Save (this will flush your permalinks in case the post type wasn’t registered already, now it will be).
Finally, you will be able to access your new page here http://your_domain.com/beach_clean
If you want to change the slug to something other than beach_clean
, add the rewrite
argument in as noted above, and make the value of it is array('slug' => 'your-custom-slug')