0

I'm developing a WP site where almost all the content is going to be static with the exception of a blog page.

Most of the static pages are going to have the same look and feel. I've already set up the header.php, footer.php and front-page.php files.

The static pages are not going to be updated very frequently, but there are multiple divs in the body of the pages which will show different graphics and content depending on the section.

My question is, since there is considerable HTML markup for the content (multiple divs, tags, CSS classes), should I just stick the HTML in the visual editor? I want the user to be able to update the content text itself without having to ask a developer. I don't see a way for a page template to extract the content itself from separate divs unless I used custom fields.

I don't see a way around inserting the HTML markup in the editor itself (maybe I'm making this harder than it needs to be) or using custom fields that can be formatted from the page template, but if there are other options or ideas out there, please feel free to let me know.

  • Use custom fields. Leave the wp editor for the main blob of text, and use custom fields for specific area of each page. There are tons of custom fields plugins out there that makes this task simple (most come with a UI interface). – gdaniel Sep 19 '14 at 17:48
  • you could add multiple tinymce editors to the Edit Page screen: it's pretty simple to do, and you can label each one, and they simply save to post meta. I can send you an example if you want to go that route. – Caleb Sep 19 '14 at 17:55
  • Thanks guys, both sound like good options. If you wouldn't mind sending me an example, @Caleb, that would be great. – user2855835 Sep 19 '14 at 18:13
0

Check out wp_editor(). There's even an example on how to add to pages towards the bottom.

add_action( 'edit_page_form', 'my_second_editor' );
function my_second_editor() {
    // get and set $content somehow...
    wp_editor( $content, 'mysecondeditor' );
}
  • @tf what if the whole page is essential for teaching? – Caleb Sep 19 '14 at 18:39

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.