• Resolved emerginggeek

    (@emerginggeek)


    Hi Ian
    I am taking the “Using Filter Hooks in WordPress Child Themes” using the Thematic theme.

    In the tutorial you reference the function thematic_postheader(). Unfortunately, I cannot find that function in the parents functions file.

    Hence, when I went onto the exercise replacing the post titles and meta with bacon it did not work. I do have to tell you that I was VERY disappointed. I have been working with sample data all week, and was excited to screw it up! πŸ™‚

    Am I using the wrong version?

    Thanks
    Dave

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi Dave,

    Here are couple quick questions that I think will help you get better help here.

      Where is the tutorial located that you are referencing?
      What version of the theme are you using?

    Here is the path to the Thematic function thematic_postheader()
    thematic/library/extensions/content-extensions.php

    In that function you’ll find a filter hook by the same name.

    Thread Starter emerginggeek

    (@emerginggeek)

    embhr
    Thanks for pointing that out.

    The tutorial is here http://themeshaper.com/2009/05/25/action-hooks-wordpress-child-themes/

    The version is 1.0.3.1

    I was under the impression that the function I was looking for was under the functions.php. Still, in the tutorial he has the reader place the snippet I referenced in the child theme functions.php we are creating…

    Dave

    Are you sure that’s the right article?

    Earlier you mentioned that you were following a tutaorail about filters. The link you provided is a tutorial about actions.

    Just checking…

    Thread Starter emerginggeek

    (@emerginggeek)

    Sorry, it was the article right before that one…

    http://themeshaper.com/2009/05/03/filters-wordpress-child-themes/

    Ok. now i see what tutorial your talking about. πŸ™‚

    The path I mentioned above is the correct path to follow to open the file where the thematic_postheader() function is defined.

    When following the tutorial you should be adding the “childtheme” namespaced functions to a child theme (not into thematic’s files) *and* you need to have the child theme activated in the Admin > Appearance > Themes.

    Check on those things and let me know how you’re getting along.

    If that continues to baffle you it could be helpful to take up this discussion at the http://thematictheme.com/forums there are likely more people over there that are spcifically working with Thematic and Thematic child themes.

    Thread Starter emerginggeek

    (@emerginggeek)

    I do have the theme activated.

    And, I think you are telling me that I have to have the function in the child’s function.php not the themes, is that correct? If so, I am doing that.

    I am still trying to get the nomenclature of everything down…

    Thanks for all the help. If I have it right, I will take the discussion to that forum. I appreciate your time.

    Which theme Thematic or the child theme?

    I don’t want to discourage you from continuing the discussion here with me and the greater WordPress community; but I do like to point out that the Thematic theme has a vibrant community specific to Thematic at ThematicTheme.com

    Thread Starter emerginggeek

    (@emerginggeek)

    lol Sorry for not being clear… I placed this code..

    function childtheme_postheader() {
        echo 'bacon';
    }
    add_filter('thematic_postheader','childtheme_postheader');

    in the childs theme’s funtion.php.

    I was under the impression that this code…

    // Information in Post Header
    // Basically the stuff you see at the top of every post
    function thematic_postheader() {
        global $id, $post, $authordata;
    
        // The Post Title
        $posttitle = apply_filters('thematic_postheader_posttitle',$posttitle);
    
        // The Post Meta
        $postmeta = apply_filters('thematic_postheader_postmeta',$postmeta);
    
        // Is this a post or a page?
        if ($post->post_type == 'page' || is_404()) {
            // If it's a page show only the Post Title
            $postheader = $posttitle;
        } else {
            // If it's a post show the Post Title and The Post Meta
            $postheader = $posttitle . $postmeta;
        }
    
        // Echo the Post Header
        echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header
    }

    Was already in the the Thematic’s function.php…

    try:

    return 'Bacon';
    instead of:
    echo 'Bacon';

    this is the confusing part…

    If you’re using add_filter you want to return the new or altered content.

    …the case may be differnet with add_action in which sometimes you will want to echo instead of returning the content.

    Give that a shot and dont forget to mark the thread Resolved if it ever reaches a point where you feel you original issue was addressed. πŸ˜‰

    Thread Starter emerginggeek

    (@emerginggeek)

    I tried return and there was no change. I think I will take it to the forum you mentioned, but I greatly appreciate your time helping me work this through.

    Thread Starter emerginggeek

    (@emerginggeek)

    Ok, here is frustration… I went there and created an account, and activated it but it says that I cannot create new topics. No way to contact anyone that I can see. I will try to look for another tutorial.

    Thanks again for your time.

    The person you would need to contact is me. I help with ThematicTheme.com I just checked the site and yes there was indeed a problem. Thanks for pointing it out. Try logging over there in again.

    Thread Starter emerginggeek

    (@emerginggeek)

    Awesome, I am in! Thank you again!

    Great News! I’ll see you over there πŸ˜‰

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Taking the "Using Filter Hooks in WordPress Child Themes" Tutorial’ is closed to new replies.