Adding new functions, general_template.php page
-
Hi,
first, wordpress forums is very helpful, I have found answers to ALL of my questions within 24 hours here. wow.In the previous version 2.6, in order to add a function, like for instance to have a template page call a different sidebar, all I had to do was define the new sidebar in the general_template.php page and presto, I got my new template page to call it’s own special sidebar.
I tried with version 2.7, and found the process of defining functions is spread all over the place and I can’t figure out how to define anything new. Here is the code in general_template.php for calling the sidebar:
function get_sidebar( $name = null ) { do_action( 'get_sidebar' ); $templates = array(); if ( isset($name) ) $templates[] = "sidebar-{$name}.php"; $templates[] = "sidebar.php"; if ('' == locate_template($templates, true)) load_template( get_theme_root() . '/default/sidebar.php'); }
Can I change this code to get a new sidebar defined? Or if not, where and how do I do that?
thanks,
JSC
- The topic ‘Adding new functions, general_template.php page’ is closed to new replies.