Archive for the ‘Wordpress’ Category

Hello Friends…,

Many of us trying to get our blog in google or yahoo or bing search engines. But adding a sitemap to web master tool is only provided for  your site where you can manually add your sitemap or you can automatically generate from http://www.xml-sitemaps.com/. Many of the wordpress plugins provide genrating and adding sitemap to blogs but in wordpress.com we can’t add plugins… adding plugins is possible in wordpress.org.

Today we will see how to add sitemap for wordpress blog in any web master tools like Google webmaster tools or bing/yahoo webmasters tool. Its very easy and simple because we don’t need to do anything. Because wordpress do it all for us. Yes… u hear right… WordPress creates and manage sitemap automatically each time. If you want to check out type your blog address and then sitemap.xml

ex.  https://skcomputerworld.wordpress.com/sitemap.xml 

You will see the sitemap.xml file over there. To add this sitemap to google/yahoo/bing webmaster tools login with your username and password add new and enter your blog address ex. https://skcomputerworld.wordpress.com/ verify it by adding meta tag to wordpress by going Tools-> Available Tools and paste your meta code over their.

After the varification click on sitemap and type following address:

<yourblogaddress>/sitemap.xml

ex. https://skcomputerworld.wordpress.com/sitemap.xml

and yes you are done. It will take some time to index/process all the pages.

 

Another Way:

             Another way is to add your categories on a wordpress page with some description with it. To do that go to categories copy all the categories by selecting all the categories. Before doing this your categories should displayed in list format and not in dropdown. So uncheck display as dropdown option from category widget area. After copying the the categories create a new page and paste it in to it.

And add some description above or below each category, name the page and save it. Rest will done by search engines automatically. It will definitely help you to get your site in search engines.

Happy Coding…!!! Happy Blogging…!!! 🙂

Sometimes we need a another page format or different user interface to display the content of pages and posts or custom type posts. Suppose you have Categories and Sub Categories Pages and you wanted to display different page format for Main Categories pages and different page format for Sub Categories. Then you can create a template to show those content on different pages.[Single page which dynamically creates interface to show content]. Template files draw information from your WordPress MySql database and generate the HTML code which is sent to the web browser.
To Create Template File:
Just Add Following Code At The Top Of The File:

<?php
/*
Template Name: Main Category
*/
?>

Adding above lines to page will make it a template file and it will shown to you when you creating  post/page/custom post under Template Option by listing the name of template, in our example: ‘ Main Category’

custom template

custom template

After adding those lines below you can enter the code of your choice to display the contents of the post/page/custom post.

Ex. :

<?php
/*
Template Name: parentpage
*/
?>

<?php get_header(); ?>
<div class=”container”>

<div class=”main”>

/* Here is the code of default page.php file you can have your own code eg. code to display custom post type */

// To know custom post type code chk my another blog post: Click Here… //

<?php the_post(); ?>

<div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<h1 class=”entry-title”><?php the_title(); ?></h1>
<div class=”entry-content”>
<?php the_content(); ?>
<?php wp_link_pages(‘before=<div class=”page-link”>’ . __( ‘Pages:’, ‘your-theme’ ) . ‘&after=</div>’) ?>
<?php edit_post_link( __( ‘Edit’, ‘your-theme’ ), ‘<span class=”edit-link”>’, ‘</span>’ ) ?>
</div><!– .entry-content –>
</div><!– #post-<?php the_ID(); ?> –>
</div> <!–main  ends –>

<?php get_sidebar(); ?>
</div> <!–#Container–>
<?php get_footer(); ?>
I know you are not getting all the things but I tried to explain in easy way. If you still have any issue or question you can comment here… We will solve it within 24 hours…. In my next article I will show you how to create your own themes.
Happy Coding…!!! -SK

With the help of Custom Field Creator Plug-in you can create custom fields like (label, text, textarea, upload, checkbox etc.). This plugin has the facility to add meta boxes[Meta Box: Collection of different fields], and you can use it repeatedly on your post/page/custom post types. You can also repeat the fields and apply required field validation on it. Isn’t it fantastic…????

Take a Look at its features:

  • Easy to create custom fields for any post type.
  • Support for Repeater Fields and Repeater Groups.
  • Drag and Drop to sort the Repeater Fields.
  • Support for all input fields: text, textarea, select, checkbox, radio.
  • Image / File upload supported via the WordPress Media Uploader.
  • Possibility to target only certain page-templates, target certain custom post types and even unique ID’s.
  • All data handling is done with ajax
  • Data is saved as postmeta

To Download Plugin:
Click Here…

After downloading goto:
Plugings–>Add New–>Upload–>Choose Downloaded File–>Open–>Install
It will take some seconds to install. After installing a new Menu added to dashboard called WCK.

Custom Field Creator-Meta Box

Custom Field Creator

Follow the instructions given. Enter metaboxname[slug] uniquie and in small letter should be single word. It will used later in our code. Select post type to which you want custom fields – meta box should displayed. Select Repeater: true/false as per your requirnment. Leave post-id empty. Select Page template if you have configured one.
To Know HOw To Create Template Visit My Another Blog About How To Create Custom Templates: Click Here…

After creating metabox add the required fields to metabox. Field title should be small letter. We are going to use it in our code.
After creating your fields. Go To Page/Post [which you selected as post type] And –> Add New Page/Post
At the bottom of wordpress editor you will see the metabox fields appered. Enter appropriate details: and click add entery. You can add multiple entries if you set Repeater =true. If not you can set now by editing metabox. After that click on publish. And select view page. And you will see nothing happens… then you are on the right track… :-p
We need to modify the page.php file in your theme. open page.php file in any editor:
Suppose we have fields:

  • Book Title
  • Book Author
  • Book Image
  • Description

Then code to display these fields on the page. Alternative you can add new template to show the content of the custom field. I assume that you are modifiying page.php: Creating template is also simple.
Add the following code to your page.php [Custmize according to your layout and css used]

//Code Start

<?php get_header(); ?>

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( ‘content’, ‘page’ ); ?>
<?php $addbooks = get_post_meta($post->ID, ‘addbooks’, true); ?>

<?php
foreach($addbooks as $addbooks)
{
$result = wp_get_attachment_image_src($addbooks[‘book-image’]);//To get image for display

$url = $result[0];

echo ‘<img src=”‘. $url.'”>’;

echo ‘<h1> ‘ .$addbooks[‘book-title’] . ‘  </h1>’;

echo ‘<h3> ‘ .$addbooks[‘book-author’] . ‘  </h3>’;

echo ‘<h5>  ‘ .$addbooks[‘description’] . ‘ </h5>’;

}
?>

<?php //comments_template( ”, true ); ?>

<?php endwhile; ?>

<?php get_sidebar();?>

<?php get_footer();?>

//End of code

Modifiy with your metabox name and field name. Save the file. And Then View The Page. You Will See The Content You Added With The Help Of Custom Field Creator WCK-Plugin.

Hope This Help You And If You Have Any Doubt Feel Free To Ask…
Happy Coding… -TK