ThemeShaper Forums » Thematic

Adding custom fields before and after the content

(3 posts)
  • Started 12 years ago by mastrom
  • Latest reply from mastrom
  • This topic is resolved
  1. mastrom

    At the moment I have a working pagetemplate that shows events, dates and time of the event is shown. Thats working ok but then I want to add the data in singlepages also. Cause I want people to go into an event and see a brief description and be able to comment. I tried making a child function that works(or atleast shows the data added)

    This is my code at the moment.

    function single_post() {

    $start = get_post_meta($post->ID,'start_date',true);
    $end = get_post_meta($post->ID,'end_date',true);
    $starttime = get_post_meta($post->ID,'start_time',true);
    $endtime = get_post_meta($post->ID,'end_time',true);

    <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
    <?php thematic_postheader(); ?>
    <div class="entry-content">
    <?php echo $start . $end . $starttime . $endtime; ?>
    <?php thematic_content(); ?>

    <?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
    <?php thematic_postfooter(); ?>
    </div><!-- .post -->
    add_filter('thematic_single_post', 'single_post');

    Its showing nothing... help appreciated

    Posted 12 years ago #
  2. Hi,

    add a

    global post;

    at the beginning of your function.


    Posted 12 years ago #
  3. mastrom

    Thanks Chris, worked nice.

    Posted 12 years ago #

RSS feed for this topic


You must log in to post.