ThemeShaper Forums » Thematic

[closed]

filters and hooks

(6 posts)
  • Started 3 years ago by antoniusblock
  • Latest reply from antoniusblock
  • This topic is resolved

Tags:

  1. antoniusblock
    Member

    noob - bottom of the learning curve here with a couple of questions. I'm trying to figure out how to use the hooks built in to thematic's header.php. Looking at the "Theme Hooks" page of the guide I see an example for adding a sidebar tweets plugin.

    1. Do I understand correctly that the code goes in the child theme's functions.php file?

    2. So if, for example, I wanted to add some html (image, canvas, div, etc) below the header, could I do something like this in functions.php:

    function add_html_here() {
    <div id-"canvas-container">...some html...</div>
    }

    add_action('thematic_belowheader', 'add_html_here');

    ?

    Posted 3 years ago #
  2. antoniusblock
    Member

    ^^ links to articles or resources that will help my understanding of hooks and filters in wp theming would be much appreciated

    Posted 3 years ago #
  3. the links above are good starting points.

    @antoniusblock, the example you first posted is very good start. that indeed will insert a new div called canvas-container below the existing thematic header div.

    function add_html_here() { ?>
    <div id-"canvas-container">...some html...</div>
    <?php }
    add_action('thematic_belowheader', 'add_html_here');

    filters can sometimes require a little more thought, but the links above and forum support will soon get you up and running.

    Posted 3 years ago #
  4. further reference (external)

    wptheming (devin) has an article on some common filters
    http://wptheming.com/2009/10/useful-thematic-filters/

    Posted 3 years ago #
  5. antoniusblock
    Member

    great - thanks guys!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.