Widgetize your home page

jdunhin

New member
Joined
Feb 27, 2013
Messages
93
Points
0
Put this code in your functions.php file
PHP:
<?php
add_action( 'widgets_init', 'my_register_sidebars' );

function my_register_sidebars() {

	/* Register the 'homepage' sidebar. */
	register_sidebar(
		array(
			'id' => 'home',
			'name' => __( 'home' ),
			'description' => __( 'Widget on home page' ),
			'before_widget' => '<div id="%1$s" class="widget %2$s">',
			'after_widget' => '</div>',
			'before_title' => '<h3 class="widget-title">',
			'after_title' => '</h3>'
		)
	);?>
Make a custom home page template and put this code in.
HTML:
		<div id="sidebar-home" class="sidebar">
       	   	<?php dynamic_sidebar( 'home' ); ?>
		</div>
This is very fast method and I use this code allot!
 

Jack London

New member
Joined
Jul 9, 2012
Messages
387
Points
0
Hi Jdunhin, good tutorial for create a widget on homepage. what can I put into that widget in wp-admin ? is it custom text widget in wordpress ?
 

jdunhin

New member
Joined
Feb 27, 2013
Messages
93
Points
0
Thank you :)

You can put in any kind of widget into that widget area! I usually put Query Posts on or basically any kind of widget.
 

Dmoz

New member
Joined
Jul 7, 2012
Messages
122
Points
0
Very details and easy to apply in wordpress theme. thanks for your short tips.
 

jdunhin

New member
Joined
Feb 27, 2013
Messages
93
Points
0
I just like helping people :) Thank you for the kind words!
 
Older threads
Replies
17
Views
5,587
Replies
17
Views
5,727
Replies
4
Views
3,269
Newer threads
Replies
12
Views
8,052
Replies
6
Views
5,222
Replies
0
Views
1,915
Replies
49
Views
20,683
Latest threads
Replies
0
Views
16
Replies
1
Views
48
Replies
1
Views
38
Replies
1
Views
53
Replies
2
Views
47
Recommended threads

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Latest Blog ArticlesMost Viewed Threads

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top