ThemeShaper Forums » Thematic

[closed]

Custom field above post content

(5 posts)
  • Started 2 years ago by Sabra
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Hi guys, I hope you can help me with this. I learned how to put some text in between the post header and the post content here: http://forums.themeshaper.com/topic/add-code-between-post-title-and-post-content

    Now, I'm trying to echo a custom field, instead of random text and I'm failing. I tried this:

    function add_code($post) {
    	if (is_single()){
    		$old_post = $post;
    		$post = echo(types_render_field('docent_website', array('show_name'=>'true')));
    		$post .= $old_post;
    	}
    		return $post;
    		}
    add_filter ('thematic_post', 'add_code');

    But it's giving me an error. Can anyone tell me what I'm doing wrong?

    Posted 2 years ago #
  2. Darn, I feel stupid but I figured it out...

    function add_code($post) {
    	if (is_single()){
    		$old_post = $post;
    		$post = types_render_field('docent_website', array('show_name'=>'true'));
    		$post .= $old_post;
    	}
    		return $post;
    		}
    add_filter ('thematic_post', 'add_code');
    Posted 2 years ago #
  3. One more question: does anyone know how I can add more than one custom field to $post ?

    Posted 2 years ago #
  4. Anyone guys? I really need this to work. :(

    Posted 2 years ago #
  5. thematic moved: http://thematictheme.com/

    Posted 1 year ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.