Theme Integration
In the htdocs directory there are a folder named as Word press. There are we have mainly three folders: wp-admin, wp-content and wp-includes. In these folders the wp-content is the most important folder. So firstly download the any word press theme and copy template in desktop then open the wp-content folder after that open themes folder and create New folder over here.
Then rename this folder as the name Anjali. e.g Anjali(theme name). Then copy the images folder of the downloaded theme in the green named folder and copy the style.css file from the green theme and if its name is default the rename it as style.css. its compulsory. After that create a index.php and style.css files and save these files are at green theme. In style.css file write down this code..
/* |
Theme URI: http://www.yahoo.com |
Author: Anjali Author URI: http://www.yahoo.com Description: Full Responsible |
Version: 1.0 License: no |
*/ |
And save this file as well as style.css file. Now open Anjali theme index page and create a print screen of this page and save in paint. Now save this file as screenshot in Anjali theme folder with png extension.
Screenshort
Now open dashboard and go to appearance and theme then check the availability of Anjali theme. then activate the theme.
Now we have BLOG LIST. Open index.php file and add a bloginfo named function in the title section in the php block. For eg:-
<title> <? php bloginfo (‘name’);?> </title>
After doing this working in the title section.we also need to include bloginfo function in the hyperlink section i.e.(<link href>)..for eg.:-
<link href=”<?php bloginfo(‘stylesheet_url’); ?>” rel=”stylesheet” type=”text/css” media=”screen”>
And to showing header image we have also use bloginfo function in the image sorce section..with in the php block..fro eg:-
<img src=”<?php bloginfo(‘stylesheet_directory’); ?>”/>
FOR NAVIGATION:-
To include navigation we add a function before navigation in the header.php file.for eg:-
<?php
wp_nav_menu(‘primary’);
?>
Separation of header
Firstly make a file and save as them as header.php and copy the header section from index.php file and cut the header section from index.php file. then call the function in index.php as
< ? php get_ header () ; ? >
Separation of Footer
Similarly copy the footer section from index.php file n paste them in a file named footer .php..cut the footer part from the index.php file..and same as we done in the header section ..include this footer in the index.php file..like:-
< ? php get_ footer () ; ? >
Including Sidebar
To include sidebar.1st of all we cut the sidebar from index.php file then copy this file in the sidebar.php file..then include the sidebar.php file in the index.php.for eg:-
<?php get_sidebar(); ?>
TO SHOW ALL THE POST IN THE CONTENT SECTION:-
Cut the content section from the index.php and copy them in the content.php file..to include the content section in the index file and to post ol the post which we post earlier are shown with the help of some functions….for eg:-
<?php
While( have posts() ):
The_post();
?>
<h2><? Php the_title(); ?></h2>
<p><?php the_content(); ?></p>
<?php
endwhile
?>
to include right sidebar:-
First of all we need to make a file of name functions.php for register sidebars and load the widgets n sidebars…
<?php
function theme_widgets_init()
{
register_sidebar(array(
'name'=> "Right Sidebar",
'id' => "sidebar_1",'before_widget' => "<div id='sidebar'>",
'after_widget' => "</div>",
'before_title' => "<h3>",
'after_title' => "</h3>"
));
}
{
Register_sidebar(array(
'name'=> "Left Sidebar",
'id' => "sidebar_2",
'before_widget' => "<div id='sidebar'>",
'after_widget' => "</div>",
'before_title' => "<h3>",
'after_title' => "</h3>"
));
}
//hooks for load widgets and sidebars
add_action('widgets_init','theme_widgets_init');
?>
After doing this work goto the dashboard .in dashboard goto appearance n den check in the appearance that both(left & right) sidebars are included or not? If included then drag any widgets in the sidebar ..
Let us we drag a widget (calender) in the right sidebarbut it is not visible on the site …to show this widgets in the site on the right sidebar. Include a condition in the sidebar.php .this is use to activate the left sidebar and the dynamic sidebar.
<?php
if(is_active_sidebar('sidebar_2'))
{
dynamic_sidebar('sidebar_2'))
}
?>
And also in the index.php file include this same condition to including right sidebar…so that calender is visible on the right sidebar…
<?php
if(is_active_sidebar('sidebar_1'))
{
dynamic_sidebar('sidebar_1');
}
?>
I made a form in this file..i.e. (contact us form)..n also create a short code.in this file we also include a class file of contactus form..n create an object of dat class then call thet object..in this file also..
<?php
}
add_shortcode('contact_form', 'formcontactus');
?>
After doing this go to dashboard of a wordpress..n den goto plugins and activate plugin which is made by us..