Title: html field
Last modified: August 22, 2016

---

# html field

 *  Resolved [laikmosh](https://wordpress.org/support/users/laikmosh/)
 * (@laikmosh)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/html-field/)
 * hello, im trying to make a template for all my blog posts, i found in the documentation
   that if i make a field named HTML, it will be displayed instead of the content
   and that this could help me create a template, but i dont really understand how
   this works, do i have to create this field in every post in my blog?
    and then
   where and how do i pull the data back to insert it in a styled template? anybody
   has some kind of example of how this would work?
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/html-field/#post-5761468)
 * Hello,
 * It’s true, there is not enough documentation explaining this feature. If there
   is a field called _html_, it will be displayed instead of the post content. It
   works on a per-post basis, so I think it’s not suitable for the purpose you need,
   to make a template for all blog posts.
 * Hmm..I’m trying to think of a good way to solve your situation. Currently, it’s
   not possible with this plugin to filter all blog posts displayed by the theme.
   It’s more suited for displaying the posts yourself, for example, in a page.
 * So, I see a couple possible solutions.
 * 1) Create a page to use as the template. Inside the page, you can use the loop,
   content and field shortcodes to display posts how you want.
 * 2) Get into the theme files to create/modify the template for posts. This would
   be a more technical solution, by copying/editing _index.php_ and _single.php_.
 *  [Peter Berger](https://wordpress.org/support/users/peterpolow/)
 * (@peterpolow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/html-field/#post-5761510)
 * If you want to make a “template” for a single post template, maybe this could
   help you. I do this as follow:
 * I created a custom post type “template” and a new (template) post named “single-
   gallery” (because I have a Gallery post type). I inserted the shortcodes I need
   in that post and saved it.
 * Then I inserted the following code in place of the default content/template fields
   in my template file “single-gallery.php” in the current theme folder:
 * `<?php echo do_shortcode('[content type="template" name="single-gallery"]'); ?
   >`
 *  Thread Starter [laikmosh](https://wordpress.org/support/users/laikmosh/)
 * (@laikmosh)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/html-field/#post-5761517)
 * thats seems like exactly what im looking for, i tried using your code but the
   content disappeared and i can only see the header and footer of the theme in 
   mi posts, could you show me how are you using this code in your single-gallery.
   php file? it would really help, thanks!
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/html-field/#post-5761521)
 * That’s a nice solution for creating templates, Peter, thanks for sharing your
   method.
 * So, laikmosh, as he said, this method requires that you create a custom post 
   type called `template`, and a template post which will display all blog posts.
   You can have a template like this, for example:
 *     ```
       <h1>[field title]</h1>
       <h2>By [field author]</h2>
       [content]
       ```
   
 * Then, in your _single-post.php_, you can replace `the_content` with the following:
 *     ```
       echo do_shortcode('[content type="template" name="single-post"]');
       ```
   
 *  [Peter Berger](https://wordpress.org/support/users/peterpolow/)
 * (@peterpolow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/html-field/#post-5761523)
 * Eliot, I have to thank you for this awesome plugin! This weekend I will make 
   a donation and write a review…
 * laikmosh, if the theme you’re using has `get_template_part( 'content', get_post_format());`
   inside (your copy of) single.php, than you have to replace it with the code from
   content.php (if you don’t want to effect the shortcodes to al your single posts).
   Than look in the code for a div with a class like “entry-content” and replace
   all the code inside that div with `echo do_shortcode('[content type="template"
   name="single-post"]');`
 *  Thread Starter [laikmosh](https://wordpress.org/support/users/laikmosh/)
 * (@laikmosh)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/html-field/#post-5761585)
 * IT WORKED!
    simple as that, i didnt have to change a bit of your code, just pasted
   it and now it works, thank you guys, you really helped me out on this one. I 
   could do this so easly with your feedback: [http://www.elbedroom.mx/blog/guia-practica/sintesis-substractiva/](http://www.elbedroom.mx/blog/guia-practica/sintesis-substractiva/)

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘html field’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

## Tags

 * [HTML field](https://wordpress.org/support/topic-tag/html-field/)

 * 6 replies
 * 3 participants
 * Last reply from: [laikmosh](https://wordpress.org/support/users/laikmosh/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/html-field/#post-5761585)
 * Status: resolved