WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I made a custom post type called "friends".

I am able to correctly list my friends using this urls:




But I have a "logic" problem with the "archive page"

My problem is:

If I use the "has_archive" option of my custom field I am able to see my page but I am not able to use SEO plugins to improve my page in term of searchability and I am not able to put some content inside the page before the while ( have_posts() ) statement using "the_content" statement I would normally use in a page template.

If I try to use a Page with the slug /slugfriends/ I am able to use SEO plugins, I can even write some content and I can then use query_posts to cycle through my friends but it seems that there is no possibility to have the same slug reserved for my custom post type. So i seems that I can have:

http://mysite/slugfriends/ (served by my page)

http://mysite/friends/friend1/ (served buy custom post type)


but I can't have:

http://mysite/friends/ (served by my page)

http://mysite/friends/friend1/ (served buy custom post type)


Is there anyone that has reached the goal to have such configuration running? Maybe using some hooks or similar? I tried in many ways but no one seems to work.

Regards, Marcello

share|improve this question

I don't know what content you want to insert in your archive page, but you can always use the file "archive-friends.php" as you can see in the Template Hierarchy to loop your "friends" post type.

Then, to customize the SEO, I recommend you the plugin WordPress SEO by Yoast because it has a strong compatibility with custom post types, so that you will be able to define your SEO description and titles for your "friends".

share|improve this answer

Your Answer


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.