Friday, 26 September 2014

How to Install WordPress Plugin and How to Use WordPress Plugin

In WordPress its only provide blog post functions, if you want to more in your site then you have to use WordPress Plugins. Like in our site below Header Section we have a slider. So find the slider plugin over net and download it.

I uses This Plugin
http://www.wonderplugin.com/wordpress-slider/

Download it and Go to Admin Panel.

  • Login with Admin Panel
  • Go to Plugin menu -> Add New
  • From Above Link Choose "Upload"
  • Choose File and Click on "Install Now" Button
  • Click on "Activate Plugin" Link.
Now Its Create a new menu "WonderPlugin Slider";

  • Click on it and click on "Create New Slider" button.
  • Click on "Add Image" Button (Its Open Popup)
  • Click on Upload Button and then click on Select Files
  • After Select Click on "OK" button
  • Add as much Image that you Want and Click on "Save & Publish" button
Now its shows you a SortCode [wonderplugin_slider id="1"]


You can Use this code for shows this slider. This Sortcode work in Wordpress Editor. If you want to show in Your file then you can use this code


<?php echo do_shortcode('[wonderplugin_slider id="1"]'); ?>

This Also Do same work, but its shows in File System.

Saturday, 13 September 2014

How To Create My Own Theme in WordPress Part - III (Main Body Section)

The WordPress is made to show the blog. So if you open index file you see

while ( have_posts() ) : the_post();

This is the post loop of WordPress. So in index page you can show blog section of your website. And if you want to show a other Page on Home page then follow this step :


  • Login to Admin Panel
  • Create a Page on your theme folder (Like : home.php)
  • Put This Code into your file :

<?php
/* Template Name: Home */

get_header(); ?>

----- Your Content -----

<?php
get_sidebar();
get_footer();
?>

Before we start you should know about these three function :
get_header() : This function include header.php.
get_sidebar() : This function include sidebar.php.
get_footer() : This function include footer.php.

Design your home page with place of --- Your Content ----


  • Now Create a page in Admin Panel
  • And select Home from Template Drop Down in Right Side box.




  • Now go to Settings Menu
  • Go to Reading Sub Menu
  • Then under "Front Page Displays" Section
  • Check A Static Page Radio Button
  • Then Choose in Front Page Select Box Your Newly Created Page.
  • Click on Save Change Button
Now your customize home page is showing.

If your site have Blog Page Then
Select Post Page Drop down.

Saturday, 6 September 2014

How To Create My Own Theme in WordPress Part - II (Header Section)

Header

Note : Before This Tutorial you have to knowledge about Designing. This Blog now provide any design related concept.

To Create Header Part create header.php File in your theme folder.

Logo : 

In most of all site the header part contain Logo and Menus. So now i discuss how to save a logo in Admin panel and how its shown in Front Site.

To Save Logo in Admin Panel :

  • Login in Admin Panel
  • Go to Appearance -> Header.
  • Choose Your Logo and Click on "Save Changes" Button.
For more about logo adding read this

To Show this Logo in Website :

<?php if ( get_header_image() ) : ?>
<div id="site-header">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
</a>
</div>

<?php endif; ?>

The Above Code Shows the Logo and make link to site home page.

After That Now we going to Create Menu :
Firstly Read this Article to Create Menus in Wordpress.

Now Paste Below Function to Show Menus :

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>

The above code shows the Menus.


Some time in Header Section There are also a Search Box.
Search Box :

<?php get_search_form(); ?>

The Above Code Shows the Search Form.


This All we are do in Header Part. Now Your Header Part is Complete.