Override the function twentytwelve_scripts_styles in a child theme

If you want to remove the entire twentytwelve_scripts_styles function, you have to remove the action hook : remove_action( ‘wp_enqueue_scripts’, ‘twentytwelve_scripts_styles’ ); However, this code have to execute after the function is being hooked by Twenty Twelve code, and before the action is fired (because after it’s too late). The child theme functions.php file is loaded … Read more

Create an extra Widget Areas in WordPress TwentyTwelve

You can create new sidebar areas by adding the following code to your theme’s functions.php register_sidebar( array( ‘name’ => __( ‘Content Sidebar’, ‘mytheme’ ), ‘id’ => ‘sidebar-2’, ‘description’ => __( ‘Sidebar description’, ‘mytheme’ ), ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</aside>’, ‘before_title’ => ‘<h3 class=”widget-title”>’, ‘after_title’ => ‘</h3>’, ) ); You can change … Read more

How to customize WordPress twentytwelve_comment function

The quick answer would probably be ‘yes’ – although it is not recommended to customize a wordpress function directly a.k.a. “hack the core”. I would strongly recommend you use a child theme to override the comments template “comments.php” which is afaik the only template actually using the function twentytwelve_comment. You could then call your own … Read more

How do I set the featured image size on the single post?

You can set the featured image size in second parameter based on this document // without parameter -> Post Thumbnail (as set by theme using set_post_thumbnail_size()) get_the_post_thumbnail( $post_id ); get_the_post_thumbnail( $post_id, ‘thumbnail’ ); // Thumbnail (Note: different to Post Thumbnail) get_the_post_thumbnail( $post_id, ‘medium’ ); // Medium resolution get_the_post_thumbnail( $post_id, ‘large’ ); // Large resolution get_the_post_thumbnail( … Read more

Twenty Twelve Theme pagination issue

You should not use query_posts at all. Everything is explained in this post I have recently done. Check out all the links as well that I’ve given in that post The big problem why your pagination doesn’t work is that the default twenty twelve pagination function, twentytwelve_content_nav, doesn’t make provision for custom queries. You can, … Read more