What's is the best way to make an archive page have editable text, as opposed to hardcoding text into the template file?

Here is what I am trying as per suggestion below.

if(is_category( '1' ))
  echo category_description( ); 


Am trying this but for some reason I can not get it to work. This is on an ARCHIVE page and Codex suggests using is category for archive pages.

  • As-written, your question cannot be answered. Please edit your question to include all your relevant code, in context: including your register_post_type() and register_taxonomy() calls. – Chip Bennett Nov 20 '13 at 17:18
  • guessing from your topic title, try to use the Category Description, possibly with a plugin to enable html code in the description. – Michael Nov 20 '13 at 17:33
  • What do you mean "best way"? How do you intend to define/maintain that editable text? Theme option? Something else? – Chip Bennett Nov 20 '13 at 17:37
  • sorry for not being clear folks. How can I add editable text to an archive page (and NOT hardcode it in.) – user31344 Nov 20 '13 at 17:40

It's a little bit hard to choose "best way", when you give so few details describing your case.

There are two most common ways I can think of.

  1. Use category description. You can then print it out in category/archive template using category_description.

  2. Make custom page template which will display posts from given category (or whatever you want). You can read more on this here (Codex/Page Templates/A Page of Posts)

Most of the times first solution should be sufficient. I would use second solution only when you have complex descriptions (you have to use a lot of formatting and some custom fields).

  • Krzysiek, i've edited the original question. Please let me know your thoughts. – user31344 Nov 20 '13 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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