How to integrate custom theme in wordpress ?


Q:-1  How to theme integration in Wordpress?
Ans:-Theme integration:-
STEP:-1   Firstely download any theme on net.
STEP:-2   After the theme download open wordprees and goto wp-content folder and open this folder .
STEP:-3   Now open themes folder and create the new folder .
STEP:-4   After creating the new folder include images and css file in this folder from download theme.
STEP:-5   Now change the name of css file.The standard name of css  file is style.css .
STEP:-6       Now make index.php file in theme folder in which we integrate theme .
STEP:-7     Now open css file and write below text in comment .
/*
Theme name:facebook
Theme URI:http://facebook.com
Author: money
version:1.0
Description: full response theme
Author URI: http://hardwarezone.com
*/


STEP:8   Now copy content from download theme into integratin theme from index.php file.
STEP:-9  Now check that theme is implement or not check detail.
STEP:-10  Now take print screen download theme (index.html)and save the file and give name screenshot.png it,s standard name of the wordpress.
STEP:-11  Now activate integrate theme and open this theme in local host.



Qns:-2 How to give title name to theme integration?
Ans:-2 <title><?php bloginfo(‘name’)  ?> </title>


Qns:-3   How to give title name to theme integration?
Ans:-3  Firstely goto dashboard.After the dashboard goto setting and the setting goto general .Now  we can do change theme tilte.


Qns:-4how to make header file and include header file?
Ans:-4Make header file:-copy header content from index file into download theme and paste into new file this file save header.php name and this file is save in theme integration folder.
        Include header file:-      <?php  get_header();?>
Qns:-5how to make footer file and include footer file?
Ans:5-Make footer file:-copy footer content from index file into download theme and paste into new file this file save footer.php name and this file is save in theme integration folder.
        Include footer file:-      <?php  get_footer();?>


Qns:-4how to make side bar file and include side bar file?
Ans:-Make side bar file:-copy side bar content from index file into download theme and paste into new file this file save footer.php name and this file is save in theme integration folder.
        Include footer file:-      <?php  get_ side bar ();?>



Qns:-5  How to make side bar in theme integration in Wordpress?
Ans:-5
STEP:-1   Fristley make function.php file intheme integration  folder.
STEP:-2  Write below text in Index.php file.
<?php


// register sidebars
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');



?>      
STEP:4  Go to appearence press enter.Go to widgets press enter.Now show side bar in the right side of the page that we are makeing.it,s show in below print screen.
STEP:5now drag and drop any plugin for example calender in side bar and give title and click on the save button.


Qns:-6how to make dyanicm side bar in wordpress?
Ans:6-Ffirstly comment all data in header.php file after the commenting include below data in header.php file.
<?php
if(is_active_sidebar('sidebar_2'))
{
    dynamic_sidebar('sidebar_2');
}
?>                    

Custom Theme Integration in Wordpress Blog


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..





Students Tech Life