I'm editing a Custom Publish Type template, and am using custom fields to go in info right into a meta box to become incorporated around the page, in addition to include some static default text on all of the pages.

I essentially have to "chunk" together the publish info within thecontent material together with the static text plus some meta box info. This is what I would like:

  • the_content
  • static text
  • meta box 1
  • more static text
  • meta box 2
  • finish from the _content

I've plug ins that add social buttons prior to thecontent material along with a signature following thecontent material and so i am trying to puzzle out ways to get my custom stuff sandwiched among individuals.

Basically just add the meta boxes i nthe template, they display outdoors from thecontent material and also the plug ins display in undesirable places.

Publish your single.php here or on pastebin together with the custom area names you are using (&lifier where you would like them) and I'll try that will help you evaluate which you would like.

I wound up foreseeing this out by myself. The answer: using functions.php and add_filter, I needed to produce a new function to produce the default content, and delay pills work great.

here's the overall code for anybody interested:

function custom_post_type_default_content($content) {
global $post;
    if ($post->post_type == 'your-custom-post-type') {
    $content .= '<p> '. get_post_meta( $post->ID, "metabox-1-slug", true ).' 
    <br />
    <p> '. get_post_meta( $post->ID, "metabox-2-slug", true ).'</p>
    <p>YOUR TEXT HERE.</p>';
add_filter('the_content', 'custom_post_type_default_content', 0);

Observe that the zero just close to the finish controls positioning. I've got a social networking wordpress plugin which has a priority of "1", and to obtain the default content to look above that I must get this to important of "".

Also note the only apostrophes that open and shut the code following $content .=

You essentially add anything you want between individuals apostrophes, as well as in this situation I'm tugging metabox info that have their very own apostrophes that contains code. It will get confusing!

Quite simply, your code ought to be $content .='YOUR CUSTOM CONTENT' and within individuals apostrophes, add your text, code, etc. The stand alone metabox code is '. get_post_meta( $post->ID, "metabox-1-slug", true ).' that is nested inside in which the YOUR CUSTOM CONTENT text is.

I'm essentially explaining this to myself, because these were things that tripped me up so figured would explain them at length to assist another person much like me. Or me when I must go look this up again!