ThemeShaper Forums » Thematic

[closed]

Rewrite post header

(3 posts)
  • Started 3 years ago by leemon
  • Latest reply from leemon
  • This topic is not resolved
  1. leemon
    Member

    Hi!

    I'm using the new custom post types feature in my site and I'd like to have different post headers depending on the post type. A custom one for the custom post type and the standard one for standard posts.

    function childtheme_postheader() {
        global $id, $post;
    
        if ($post->post_type == 'custom') {
            // custom post header
            $custom = get_post_custom($post->ID);
            ...
            $postheader = ...
        } else {
            // standard thematic post header
            $postheader = ...
        }
    
        return $postheader;
    
    }
    add_filter ('thematic_postheader', 'childtheme_postheader');

    Is there a way to call the original thematic_postheader() function inside my customized one? I'd like not to have to paste its whole code in the 'standard thematic post header' section. Am I making any sense?

    Thanks in advance

    Posted 3 years ago #
  2. i think add_filter would not be the way to go in this case. i think i would use the override and do something like

    function childtheme_override_postheader(){
    
    if ($post->post_type == 'custom') {
            // custom post header
            $custom = get_post_custom($post->ID);
    
            $postheader = "some bacon";
    
            return $postheader
        } else {
            thematic_post_header();
        }
    
    }
    Posted 3 years ago #
  3. leemon
    Member

    Thanks! I'll try this.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.