0

In WP 3.3, how can I extend the Twenty Eleven theme such that I can make some custom additions or modifications but still take benefit in the updates that WP pushes out for the theme? Sort of like 'overloading' in programming, I guess.

For now, I would like to include a custom css file and jQuery in header.php, and add a js function to single.php.

1 Answer 1

2

You can do this by making a child theme. All the information about setting up a child theme can you find here: http://codex.wordpress.org/Child_Themes

3
  • So it's easy for the css but what for the js?
    – Ben
    Commented Dec 25, 2011 at 22:51
  • Just add js to your child theme.
    – Brooke.
    Commented Dec 26, 2011 at 0:23
  • To clarify, yes you can do this. You can copy the single.php to your child theme and add the js functions in there. Or you can enqueue your script in your single template via a functions.php in your child theme (codex.wordpress.org/Function_Reference/wp_enqueue_script). Use if( is_single() ) { wp_enqueue_script( 'your-js', get_stylesheet_directory_uri() . '/js/your.js' ); } to add your js file. Commented Dec 26, 2011 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.