ThemeShaper Forums » Thematic

[closed]

Add Custom Field to Thematic_loop for Page Only

(3 posts)
  • Started 2 years ago by wireframe74
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Hi I am trying to add something to a page which allows me to store a cstom field which contains an intro paragraph for pages that I have set up. Below is my code. Advice appreciated!

    function parentExcerpt () {
    if (get_post_meta($post->ID, 'breakout_text', true) ) : ?>
    <h3><?php echo get_post_meta($post->ID, 'breakout_text', true); ?></h3>
    <?php endif;
    }

    add_action ("thematic_post", "parentExcerpt", 5);

    ?>

    Posted 2 years ago #
  2. I managed to put the above the_content(); which worked for pages

    <?php
    if (get_post_meta($post->ID, 'breakout_text', true) ) : ?>
    <h3 id="introText"><?php echo get_post_meta($post->ID, 'breakout_text', true); ?></h3>
    <?php endif;

    But surely there is a neater way to do this?

    Posted 2 years ago #
  3. thematic_post is not a hook you can add stuff too, but you can attack it w/ a filter....

    function sample_filter($content){
        $content = 'bacon rules! ' . $content;
    }
    add_filter('thematic_post','sample_filter');

    will add my love for bacon to the beginning of every post

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.