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.

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

  • So it's easy for the css but what for the js? – Ben Dec 25 '11 at 22:51
  • Just add js to your child theme. – Brooke. Dec 26 '11 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. – Rob Vermeer Dec 26 '11 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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