Twenty Twelve Widget Taking Space

There are some confusing information in your question and some important information missing Did you set a static front page as it is suggested in your code Do you need to achieve this on your front page or homepage Why aren’t you using the front-page.php template included if you have set a static front page, … Read more

Escape HTML on WP input

The default text widget – WP_Widget_Text – can be found in wp-includes/default-widgets.php. The input is handled like this: stripslashes( wp_filter_post_kses( addslashes( $text ) ) ); for the text; I assume this should work likewise for your custom widget. Additionally there is: wpautop( $text ) on the output, if the filter is set to do that; … Read more

Why isn’t my custom widget outputting any content?

Using the_widget() denies those $instance variables being set, which they normally are when you stick it in a Sidebar in the back end. Try something like this: the_widget(‘bannerWidget’, array( ‘title’ => ‘WordPress rocks!’, ‘text’ => ‘Hello World.’, ‘textarea’ => ‘Some content for the textarea’ ) ); the_widget is for hard-coded widgets. To use the one … Read more

display specific widget to a page

you can create new widget area. function header_widget_areas() { register_sidebar( array( ‘name’ => __( ‘header’, ‘header’ ), ‘id’ => ‘header’, ‘description’ => __( ‘Insert something for about us text.’, ‘header’ ), ‘before_widget’ => ‘<div class=”widget span3″>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<h4>’, ‘after_title’ => ‘</h4>’, ) ); } add_action(‘widgets_init’, ‘header_widget_areas’); Then place your widget in … Read more

Do I have to widgetize my pages?

Use page templates and template parts. On your Front Page, you include the Texts as Template Parts: Front Page +—————+—————+—————+ | Page A | Page B | Page C | +—————+—————+—————+ | Link Page 1 | Link Page 2 | Link Page 3 | | Text 1 (TP1*) | Text 2 (TP2*) | Text 3 … Read more

Tags Instead of Category

I think your idea is really nice here, but you have a couple of serious flaws in your code. Never use extract(), ever. It is extremely hard to debug and can render unexpected output. It has now been completely removed from core, except in one instance as far as I can pick up from this … Read more