This post is the continuation of my earlier post WordPress for beginners. If you haven’t gone through it yet I suggest you to have a look at that before reading further this post. Well for the visitors who already have some basic idea about WordPress ,this post is intended to give more power to customize your blog’s content and of course its look and feel. Suppose in our current theme you want to remove some contents ( e.g Search, Recent Comments, Meta etc) from widgets bar, search bar should appear on header section or in some cases you might don’t want to appear some posts in home page and rather would like to move them to another category say “myfavouritepost” .Let’s get started.

Remove some widgets contents

From your dashboard navigate to Appearance->Widgets , select your item from the widgets bar and delete it.


Displaying search bar in header section

To make appear the search bar in header section, go to your parent theme directory and copy the file header.php and paste it into child theme directory. Now open the header.php in your editor and add the below code after line no 42 and save it.

//……other codes……………
  <?php get_search_form(); ?>
//……other codes…………….

Now let’s give some styling to the search bar. Open the style.css and add the below code.

.search-field {
    font-weight: normal;
    width: 58%;

Now let’s also give some styling to our footer content. Just copy and paste the below code into style.css.

.widget-area aside {
    height: auto !important;
.widget-area {
    padding-bottom: 0;
ul, ol {
    margin: 0;
    padding: 0;
ul {

Restricting some posts to appear in home page

Let’s first create a category and some posts on that category and restrict them to appear in the home page. To create a new category navigate to Posts->Categories and fill the category name e.g myfavoritepost and click on the Add New Category button. That’s all , now you have a new category. Now create some new posts and save them in the newly created category.


Now go to parent theme directory and copy the file index.php and paste it into the child theme directory and open it in the editor and replace all the codes with the below given.

get_header(); ?>
	     // the query
		$category_id = get_cat_ID('myfavoritepost');
		$the_query = new WP_Query( 'cat=-'.$category_id); 
		<?php if ( $the_query->have_posts() ) : ?>
			<?php /* Start the Loop */ ?>
			<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
					/* Include the Post-Format-specific template for the content.
					 * If you want to override this in a child theme, then include a file
					 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
					get_template_part( 'content', get_post_format() );
			<?php endwhile; ?>
			<?php casper_paging_nav(); ?>
		<?php else : ?>
			<?php get_template_part( 'content', 'none' ); ?>
		<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

In the above code the key point to note down is the get_cat_ID() function which takes the category name as the parameter and returns the category id. Now we query the database using the function WP_Query( ‘cat = -category_id ’) which outputs the results excluding the specified category id. That’s how we managed to hide some category posts from appearing in the home page.

Now let’s add the newly created category to the menu and show your favorite posts. To do so , navigate to Appearance -> Menus->Categories and select your category to add into the menu. Finally click on the create menu button and select both checkboxes in the menu settings and save it.

Yeah, that’s all how you can customize your wordpress blog or make changes to it.What you waiting for now ? Start blogging right now ! Kindly feel free to share anything you know and leave a comment below.