I have a custom post type named "Products" and a taxonomy called "Usage". On my "Products" landing page I'd like to have custom content that can be edited via WYSIWYG by the client. Same goes for the taxonomy landing page. My thought was to create fake Pages and just pull the content via ID into my archive-products.php and taxonomy-usage.php templates but I was curious if there was a better way to handle it.

2 Answers 2


First solution can be using the Settings API and create 2 fields "Products Description" and "Usage Description", after that showing in your template that fields is easy like a:

$options = get_option('my_theme_options');
echo $options['prod_description'];
// echo $options['usage_description'];

However, settings API is not the best part of WP core, and probably create a settings page for only that fields doesn't worth it.

Another approach is use page (with a custom page template) as archive.

Create a page and call it "Product Archive"

In it put something like that:

Template Name: Products Archive


 if ( have_posts() ) the post();

 the_content(); // this will output the page content     

 $p_query = new WP_Query('post_type=products');
 if ( $p_query->have_posts() ) { while( $p_query->have_posts() ) {
   // this will require a 'entry-product.php' where you can put all your product markup
   get_template_part('entry', 'product');
 } }


After that, in your backend, create a page and assign it to the template just created. Write whatever you want in the page content and when you will open the page, you'll see the page content and the products.

The same can be done for taxonomy page. Just change the page template and the query in it.

If, for any reason, you need to use archive-products.php as product archive, an alternative is create a custom template, but use it only to retrieve the page content.

Create a php file in your theme, and name it 'page-prod-description.php'. In this file put only:

Template Name: Products Description
wp_safe_redirect( home_url() );

What this file does, is creating a custom page template. That template can be attached to pages, but those pages can't be called directly, because if you try it you'll be redirected to home page.

Now login on your backend and create a page, title it "Products Description" and assign the page template just created. If you try to access the page http://example.com/product-description you'll be redirected to home page.

In your product archive template, archive-products.php, you can use the content inserted in that page like so:

$desc = get_pages('meta_key=_wp_page_template&meta_value=page-prod-description.php');
if ( ! empty($desc) ) {
   $page = array_shift($desc);
   echo apply_filters('the_content', $page->post_content );

Now your clients can login in backend and edit the page "Products Description" and everything is wrote in the page content will be shown in the archive page.

The same, off course, can be done for taxonomy archive.

  • But doing this will affect the main_query object $wp_query and cause it to not output the right post_type for the query happening on archive pages. Which will make your calls to filters like pre_get_posts for an archive page worthless. This is the main problem. Wordpress needs to provide a means to MANAGE Post Type Archives and Taxonomy Archives Content also. Nov 11, 2017 at 0:00
  • Both methods you provided are a Sloppy way of handling this. But unfortunately there is no clean way of doing this. Wordpress needs to provide a clean way here, IMO! Nov 11, 2017 at 0:01

You could create normal pages, then apply custom templates which contain the appropriate custom loop to output the CPT. Or you could create an options page (or add an option to the Theme Customizer), where the client can add content via WYSIWYG, and then output this content in the appropriate archive template.

  • Any example of the basic code you would use to do that? Feb 7, 2014 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.