Adding actions to wordpress based on events

add_action($tag, $function_to_add, $priority, $accepted_args);
add_filter($tag, $function_to_add, $priority, $accepted_args);

The $tag parameter is where you specify the hook you want to add to; $function_to_add is the name of your function. The next two are optional, but worth knowing about: $priority is used to determine the order in which your action ought to occur, relative to other actions that might be happening on the same hook—larger numbers happen later. $accepted_args

And to remove them (notice you have to do this indirectly):

function remove_some_filter() {
  remove_filter(tag, function, priority, args);
}

add_action('init', 'remove_some_filter')


Example:

add_action('wp_head', 'wicked_favicon')

This runs everytime the page head is constructed, you can have the specific function inside functions.php:

function wicked_favicon() {
  echo '<link rel="shortcut icon" href="' 
      . get_bloginfo('stylesheet_directory') 
      . '/images/favicon.ico"/>';
}

Basic wordpress functions

All functions you want to overwrite, you can put it inside functions.php on your child theme, regarding pre-established functions:

  • get_header grabs header.php

  • get_footer grabs footer.php

  • get_sidebar grabs sidebar.php

  • get_searchform grabs searchform.php—if this is missing, WordPress simply renders a default search form

  • comments_template grabs comments.php

  • get_header('custom'), for example, will grab a file called header-custom.php
  • get_template_part('partname'), which grabs a template called partname.php
  • include(STYLESHEETPATH . ‘/extrastuff/somefile.php’); use the path to your stylesheets to get to a file, you can also use TEMPLATEPATH

WordPress: choosing and modifying a theme

1) Download thematic (as the parent theme)
2) Create a child theme folder for the new site, and activate it using wordpress admin screen
3) Choose the basic layout you need, by modifying this line:
@import url(‘../thematic/library/layouts/2c-r-fixed.css’);
You can also create your own layout at this point if you feel like it. Same with typography or other things.
4) You can also modify the default main css to your site by creating a local copy on your child theme:
@import url(‘newstyles.css’);
5) Modify the templates and functions from the parent directory directly at the child’s folder, that way
you can always update the parent theme without affecting the child

Correction: 20/11 newest wordpress theme is set to be HTML5 already. Use that instead.