WordPress.org

Ready to get started?Download WordPress

Forums

Thematic
[resolved] Taking the "Using Filter Hooks in WordPress Child Themes" Tutorial (18 posts)

  1. emerginggeek
    Member
    Posted 1 year ago #

    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

  2. Gene
    Member
    Posted 1 year ago #

    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.

  3. emerginggeek
    Member
    Posted 1 year ago #

    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

  4. Gene
    Member
    Posted 1 year ago #

    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...

  5. emerginggeek
    Member
    Posted 1 year ago #

    Sorry, it was the article right before that one...

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

  6. Gene
    Member
    Posted 1 year ago #

    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.

  7. Gene
    Member
    Posted 1 year ago #

    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.

  8. emerginggeek
    Member
    Posted 1 year ago #

    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.

  9. Gene
    Member
    Posted 1 year ago #

    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

  10. emerginggeek
    Member
    Posted 1 year ago #

    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...

  11. Gene
    Member
    Posted 1 year ago #

    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. ;)

  12. emerginggeek
    Member
    Posted 1 year ago #

    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.

  13. emerginggeek
    Member
    Posted 1 year ago #

    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.

  14. Gene
    Member
    Posted 1 year ago #

    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.

  15. emerginggeek
    Member
    Posted 1 year ago #

    Awesome, I am in! Thank you again!

  16. Gene
    Member
    Posted 1 year ago #

    Great News! I'll see you over there ;)

  17. emerginggeek
    Member
    Posted 1 year ago #

    Fixed! Thanks again for your time, emhr!

  18. Gene
    Member
    Posted 1 year ago #

    Glad you got it all worked out.

    I realize that your just getting started with Thematic. If in time you find that you have learned from your experience with Thematic, it'd be awesome if you could take a moment or two to submit a review of your experience with the theme.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.