Showing posts with label Featured. Show all posts
Showing posts with label Featured. Show all posts

Oct 4, 2012

iPhone 5 Will Cost You at Least $1,800

You might have heard that

Buy an iPhone 5 From $199
Buy online and get free shipping.
Or visit your favorite Apple Retail Store.

Here's the Info-graphic which shows that iPhone 5 Can Cost You at Least $1,800!


iPhone 5 Infographic

Oct 25, 2011

How to use Views Slideshow in Drupal 7

1. Required Modules (Version: Drupal 7.8)

  1. Views (7.x-3.0-rc1)
  2. Views Slideshow (7.x-3.x-dev)
  3. Chaos tool suite (7.x-1.0-rc1)
  4. Libraries (7.x-1.0)
  5. Link (7.x-1.0)
  6. Token (7.x-1.0-beta6)

2. Install the Modules

In Drupal 7 you can install modules from the admin section, but I still feel this new feature doesn't have any meaning, because we have to search for the module link in the Drupal site and then copy paste into the admin module installation area, it would have been so good if they would have made it something like WordPress a small search feature. Anyway I just gonna download and install it in the old way (I still recommend this old way).
Download all the above listed modules from http://drupal.org/project and install in the directory examplesite.com/sites/all/modules

Go to http://www.examplesite.com/admin/modules and enable these modules as below:

Modules - Drupal
Enable Modules
  1. Views
  2. Views UI
  3. Views Slideshow
  4. Views Slideshow: Cycle
  5. Chaos tools
  6. Libraries
  7. Link
  8. Token

3. Create Image Cache

In Drupal 7 imagecache is part of core module and is named as Image styles. So let's create two image cache from here, one for the full size slider image and other for the thumbnail image. In this tutorial I use 640x480 (pixels) dimension for the full size slider image and 320x240 (pixels) dimension for the thumbnail image. Note: These configurations can be defered depends on your needs.

Fullsize Slider image settings

Go to http://www.examplesite.com/admin/config/media/image-styles and click on the add new style link

  1. Give an Image style name and click on create new style button.
  2. On the next configuration screen select new style you want and then click add button (In this tutorial I choose re-size style).
  3. On the next screen set the width and height and click on the add effect button. (The settings may vary depend on the style you choose). I set width as 640 and height as 480 pixels.
  4. Do this same process for the thumbnail image too. (for the thumbnail image dimension, I set width as 320 and height as 240 pixels.)

4. Create New Content Type

Let's create a new content type, from the dashboard menu bar cick on Structure and then Content types then click on the add new content type link.

  1. Give a human-readable name, I named it as Featured Slider (machine name will be auto generated based on the human readable name)
  2. Give a brief and relevant description
  3. Submission form settings, I leave as the default settings
  4. Publishing options, I checked only published (all other settings unchecked)
  5. Display settings, I have unchecked the authour and date info.
  6. Comment settings, I set hidden (disabled)
  7. Menu settings, I leave as default settings.
  8. Click Save and add fields Button

5. Create New Fields

Here in this example I'll create only two fileds, and they are image field and link field. We will use image field for uploading our slider image and link field for creating a custom link where we want our slider to be linked.

  1. Image Field Settings
  2. Label: Slider Image
  3. Field: slider_image
  4. Field type: image
  5. Widget (form element): image
  6. Click Save button, and on the field settings page leave default settings and click on Save field settings button.
  7. On the image field configuration settings page you can configure as you wish.
  • I set this field as required, I added a file director name called slider-image so that this images will be arranged separately from other images.
  • You can set the maximum upload size and resolution here, I have enabled alt and title field and finally click Save settings button.

By using same method create the link field too.

Link Field Settings:

  1. Label: Slider Link
  2. Field: slider_link
  3. Field type: link
  4. Widget (form element): link
  5. Click "Save" button

Note: For the link field configurations leave everything to default settings.

I have re arranged the field like shown below:

  • Title field
  • Image field
  • Link field
  • Body field (you can even remove this field if not necessary)

Manage Display

On the manage display tab you can conigure how the out put of the field to be diplayed, I have set the image label as hidden.

6. Create Feature Slider Content

I have created four featured slider content for this tutorial.

  1. Click on add content link
  2. Create Featured Slider content
  3. Give a proper title name
  4. Upload slider image
  5. Give alt and title field names
  6. Give a link title and url where you want the slider to be linked
  7. Leave all othe settings as default except for the path field if you want you can give an SEO friendly URL alias.
  8. Save the content.

Repeat the steps twice or thrice to create some more featured slider contents for your slide (I have created four contents)

7. Create a New View

Now it's time to create our new Slideshow view. From the Dashboard menu click on the Structure and then click on the Views.

  1. Click add new view link
  2. Give view name, I have named as Featured Slider (machiine name will be auto generated)
  3. Give an apropriate view description
  4. Choose Show Content of type Featured Slider (your content type name).
  5. Uncheck Create a Pge and check Create a block
  6. Type in Block title and choose display format as "Slideshow" of "fields" items per page 5 (you can enter the number of items you want to display)
  7. Click the button "Continue & edit"

Views Field Settings

  • Add "Link" Field
  1. "Link" must be the first field in order to work everything properly, so click on the add icon and from the filter Groups select "Content"
  2. Add Content: "Link" "Appears in: node:featured_slider."
  3. Click: "Add & configure button"
  4. In the next cofiguration window uncheck "Create a label" and check "Exclude from display"
  5. Click "Apply button".
  • Add "Image" Field
  1. Click on the add icon and from the filter Groups select "Content"
  2. Add Content: "Image" "Appears in: node:featured_slider." (Note: Make sure you choose the "Image" field which we created for this slider content type only.)
  3. Click "Add & configure button"
  4. In the next cofiguration window uncheck "Create a label"
  5. Formatter: "Image" (If you have installed "Colorbox" or "Lightbox2" you can choose them here.)
  6. Image Style: "Fullsize" (Choose the imagecache you have created in the above step "3. Create Image Cache")
  7. Link image to: "Nothing"
  8. Style Settings: "Leave default settings"
  9. No result behaviour: "Leave default settings"
  10. Rewrite Results: Check "Output this field as a link"
  11. Link path: [view_node] (Note: Scroll dow a bit and you can see replacement patterns created by Token module, (If we didn't set the link field as first we can't see link field option here) copy only [view_node] then scroll up and paste it in the link path field.)
  12. Click "Apply button".
  • Add "Thumbnail" Field
  1. Click on the add icon and from the filter Groups select "Content"
  2. Add Content: "Image" "Appears in: node:featured_slider." (Note: Make sure you choose the "Image" field which we created for this slider content type only.)
  3. Click "Add & configure button"
  4. In the next cofiguration window uncheck "Create a label" and check "Exclude from display"
  5. Formatter: "Image" (If you have installed "Colorbox" or "Lightbox2" you can choose them here.)
  6. Image Style: "Thumbnail" (Choose the imagecache you have created in the above step "3. Create Image Cache")
  7. Link image to: "Nothing"
  8. Style Settings: "Leave default settings"
  9. No result behaviour: "Leave default settings"
  10. Rewrite Results: Check "Output this field as a link"
  11. Link path: [view_node] (Note: Scroll dow a bit and you can see replacement patterns created by Token module, (If we didn't set the link field as first we can't see link field option here) copy only [view_node] then scroll up and paste it in the link path field.)
  12. Click "Apply button".

Views Filters Settings

In Views 3.x the filters are created in the beginning while we choose the content type and other settings. If you need any additional filtering you can create it here.

Views Style Settings

Click on the "Format Slideshow Settings" and on the next configuration window set as below:

  • List type: "Unordered list"
  • Wrapper class: "Leave default settings"
  • Style » Skin: "Deafult"
  • Slides » Slideshow type: "Cycle"

"Cycle Options"

You need to download jQuery cycle plugin and copy jquery.cycle.all.min.js to sites/all/libraries/jquery.cycle You can find the plugin at http://malsup.com/jquery/cycle.

In a Simpler Manner

Create a folder named "libraries" in your "examplesite.com/sites/all/" directory and then create an another folder named "jquery.cycle" in that directory and finally copy and paste only the "jquery.cycle.all.min.js" into this directory. For e.g. examplesite.com/sites/all/libraries/jquery.cycle/jquery.cycle.all.min.js

  • Transittion: "Fade"
  • Action: "Pause on Hover"
  • Internet Explorer Tweaks: "Default"
  • Widgets: You can choose either or both Top and Bottom (I choose bottom here, and the advance settings as below:)
  • Bottom Widgets » Pager » Pager type: "Fields"
  • Pager field » Content: "Image" (Note: Last one we added for the thumb, don't mistake since both field will be named same.)
  • Activate Slide and Pause on Pager Hove: Checked » "Controls" and Unchecked » "Slider Counter"
  • Click on "Apply button".

Format Show Field Settings

  • Inline fields: "Choose the thumbnail field as inline."
  • Click on "Apply button." (Note: Well it actually doesn't change much in appearance but it does change in the code.)

8. Enable & Configure the Block

Now this block will be visible in the blocks disabled area, so from the Dashboard menu go to Structure » Block and "Enable" the block to a themes default region or any of the custom region you've created. (Regions varies depends on the theme you are using.)

Block Configuration Settings

After enabling the block you get a link to configure the block so click on the "Configure" link and on the settings section set as below;

  • Block title (If you don't want block title to be displayed just type <none>)
  • Again you get all enabled theme specific Region settings.

On Visibility Setings

  • Pages » Show block on specific page: choose Only the listed pages and typeso that this block will be displayed only on the front page.

Oct 7, 2011

Must have modules for creating a site in Drupal 7.x

Ctools

This suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels.

Custom Breadcrumbs

Allows administrators to set up parametrized breadcrumb trails for any node type. This allows CCK-style node types to have "Home > User Blog > 2005 > January" style breadcrumbs on the node view page itself, synchronizing cleanly with custom views or pathauto aliases. Breadcrumb visibility can be customized via a php snippet.

No new features are planned for these versions, but they are still supported and bug reports are encouraged.

Fivestar

The Fivestar voting module adds a clean, attractive voting widget to nodes in Drupal 5, node and comments in Drupal 6, and any entity in Drupal 7

Panels

The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions.

Pathauto

The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias. This allows you to get aliases like /category/my-node-title.html instead of /node/123. The aliases are based upon a "pattern" system which the administrator can control.

Porter-Stemmer

This module implements the Porter stemming algorithm to improve English-language searching with the Drupal built-in Search module.

The process of stemming reduces each word in the search index to its basic root or stem (e.g. 'blogging' to 'blog') so that variations on a word ('blogs', 'blogger', 'blogging', 'blog') are considered equivalent when searching. This generally results in more relevant search results.

Rules

The rules modules allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules).

Token

Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user]. The Token module provides a central API for modules to use these tokens, and expose their own token values.

Views

The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Traditionally, Drupal has hard-coded most of this, particularly in how taxonomy and tracker lists are formatted.

This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. It has four modes, plus a special mode, and provides an impressive amount of functionality from these modes.

Among other things, Views can be used to generate reports, create summaries, and display collections of images and other content.

Webform

Webform is the module for making surveys in Drupal. After a submission, users may be sent an e-mail "receipt" as well as sending a notification to administrators. Results can be exported into Excel or other spreadsheet applications. Webform also provides some basic statistical review and has and extensive API for expanding its features.

Jul 14, 2011

Create a WordPress theme | How to create WordPress Theme

First thing to do is to create a sub-folder in the wp-content/themes directory in your WordPress folder. Lets say we name it as "My_Theme". Also note that the name of the folder should correspond to the name of the theme you want to create. To do this you can either use your favorite FTP client or the File Manager tool in your cPanel.

You should first think of the layout of your website, i.e how your website will look..??..In this tutorial we will create a wordpress theme which will contain a header , sidebar , main content area and lastly a footer at the end as shown in the fig.



We will have to create the following files in the directory we made i.e "My_Theme" as I mentioned earlier. Following are the files :-

  • header.php - This file will contain the code for the header section of the theme;

  • index.php - This is the main file for the theme. It will contain the code for the Main Area and will specify where the other files will be included;

  • sidebar.php - This file will contain the information about the sidebar;

  • footer.php - This file will handle your footer;

  • style.css - This file will handle the styling of your new theme;


You can either create those files locally with a simple text editor(like notepad for example) and upload them via FTP or you can use the File Manager tool in your cPanel to create the files directly on your hosting account.

We will now go through contents of each files.

The header.php file


following code should be added to this file

[php]

<html>
<head>
<title>Tutorial theme</title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
</head>
<body>
  <div id="wrapper">
    <div id="header">
      <h1>HEADER</h1>
    </div>

[/php]

It basically contains simple HTML code with a line containing a php code and a standard WordPress function. In this file you are dealing with your meta tags such as the title of your website, meta description and the keywords for your page.

After the title the line we add <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"> this will tell WordPress to load the style.css file. To handle all the styling/looks of your website. The <?php bloginfo('stylesheet_url'); ?> part of the line is a WordPress function that actually loads the stylesheet(stylesheet.css) file.

Next, we have added the beginning of a "div" with class wrapper which will be the main container of the website. We have set class for it so we can modify it via the style.css file.

The next step we have added a simple label HEADER wrapped in a "div" with class "header" which will be later specified in the stylesheet file.

The index.php file


following code should be added to this file



[php]</p>
<p style="text-align: left;"><?php get_header(); ?>

<div id="main">
  <div id="content">
    <h1>Main Area</h1>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <h4>Posted on <?php the_time('F jS, Y') ?></h4>
    <p><?php the_content(__('(more...)')); ?></p>
    <hr>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
  </div>

  <?php get_sidebar(); ?>

  </div>

<div id="delimiter"></div>

<?php get_footer(); ?></p>
<p style="text-align: left;">[/php]

The code in this file begins with <?php get_header(); ?> which will include the header.php file and the code in it in the main page. It uses an internal WordPress function to do this. We will explain this in details later in this tutorial. Then we have placed a Main Content Area text to indicate which section of your theme is displayed in this area.


The next few lines consist of a PHP code and standard WordPress functions. This code checks whether you have posts in your blog created through the WordPress administrative area and displays them.

Next, we include the sidebar.php file with this line - <?php get_sidebar(); ?>. In this file you can display your post categories, archives etc.

After this line, we insert an empty "div" that will separate the Main Area and the Sidebar from the footer.

Finally, we add one last line - <?php get_footer(); ?> which will include the footer.php file in your page.

 The sidebar.php file


following code should be added to this file

[php]

<div id="sidebar">
  <h2><?php _e('Categories'); ?></h2>
  <ul>
    <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
  </ul>

  <h2><?php _e('Archives'); ?></h2>
    <ul>
      <?php wp_get_archives('type=monthly'); ?>
    </ul>
</div>

[/php]

In this file we use internal WordPress functions to display the Categories and Archives of posts. The WordPress function returns them as list items, therefore we have wrapped the actual functions in unsorted lists (the <ul> tags).

The footer.php file


following code should be added to this file

[html]

<div id="footer">
  <h1>FOOTER</h1>
</div>

</div>

</body>
</html>

[/html]

With this code we add a simple FOOTER lable. Instead of this code you can add links, additional text, the copyright information for your theme and additional objects.

The style.css file


following code should be added to this file

[css]

body {
    text-align: center;
}

#wrapper {
    display: block;
    border: 1px #a2a2a2 solid;
    width:90%;
    margin:0px auto;
}

#header {
    border: 2px #a2a2a2 solid;
}

#content {
    width: 75%;
    border: 2px #a2a2a2 solid;
    float: left;
}

#sidebar {
    width: 23%;
    border: 2px #a2a2a2 solid;
    float: right;
}

#delimiter {
    clear: both;
}

#footer {
    border: 2px #a2a2a2 solid;
}

.title {
    font-size: 12pt;
    font-family: Latha;
    font-weight: bold;
}

[/css]

This simple css file sets the basic looks of your theme. Those lines  set the background of your page and surround the main parts of your site with borders for convenience.


And that is it your theme is ready for use.


From now on you can modify the CSS file, add images, animations and other content to your theme in order to achieve the looks you want for your website or blog. Hope this tutorial helped you achieve what you wanted.

Jul 10, 2011

How to show a message in the WordPress Admin

If you are working on a plugin or a theme, and you want to display some message to the user like "Settings have been saved" or "Plugin installed, Please goto settings page to configure it", then just follow the below snippet.

[php]
/**
* Generic function to show a message to the user using WP's
* standard CSS classes to make use of the already-defined
* message colour scheme.
*
* @param $message The message you want to tell the user.
* @param $errormsg If true, the message is an error, so use
* the red message style. If false, the message is a status
* message, so use the yellow information message style.
*/
function showMessage($message, $errormsg = false)
{
if ($errormsg) {
echo '<div id="message" class="error">';
}
else {
echo '<div id="message" class="updated fade">';
}

echo "<p><strong>$message</strong></p></div>";
}
[/php]
Now we just add a hook to the admin notices function to show our custom message.

[php]
/**
* Just show our message (with possible checking if we only want
* to show message to certain users.
*/
function showAdminMessages()
{
// Shows as an error message. You could add a link to the right page if you wanted.
showMessage("You need to upgrade your database as soon as possible...", true);

// Only show to admins
if (user_can('manage_options') {
showMessage("Hello admins!");
}
}

/**
* Call showAdminMessages() when showing other admin
* messages. The message only gets shown in the admin
* area, but not on the frontend of your WordPress site.
*/
add_action('admin_notices', 'showAdminMessages');[/php]

Done.....

Get how many posts are returned by a custom loop

To get the output, just paste the following snippet anywhere in your themes file.

[php]
$feat_loop = new WP_Query( 'showposts=12&amp;category_name=featured' );
echo "Query returned ".$feat_loop-&gt;post_count." posts.";
[/php]

Jul 5, 2011

Whats new in Wordpress 3.2 | What is wordpress 3.2

WordPress being  an open source blog tool and publishing platform powered by PHP and MySQL has always put in efforts to serve the best and advanced features to users for their ease and competency and the past few months is not a joke with the WordPress3.2.
With the release of wordpress 3.1 with a surprise after a couple of months comes wordpress 3.2 with more advanced features enhancing user experience.  The wordpress community is growing rapidly and the apex of it being the release of wordpress 3.2 which is the 15th major release of wordpress.
"WordPress 3.2 contain various new and inspiring updates which will make WordPress more lighter and faster than ever before."
-Mark Jaquith

Wordpress 3.2 key features/highlights

  • New Dashboard View


dashboard




  • New Themes View


theme-view




  • New Menu View


menu-view




  • New Widget View


widgets-view




  • New Plugins View


plugins-view




  • New Post View


new-post-view




  • Distraction Free Writing


Distraction Free Writing is another major update to the WordPress 3.2 writing interface for quite some time. The writing interface of WordPress 3.1 was cleaned up a bit by hiding Meta Box (Custom Fields, Author, etc) by default. So you can just focus on the content by using Distraction Free Writing feature. The aim to introduce Distraction Free Writing is to make the writing experience faster, calming and lightweight.


distraction-free-writing




  • Speedy Improvements


Use of large database can stop a website in wordpress. Although WP provides continuous support to some old technology in the core files which wont be availbe in WP3.2, making it load faster.


Research still going on by NAcin to make the admin load faster along with FTP improvement which upgrades faster by expansion in php.




  • Auto Upgrading Improvements


Improved Upgrading feature is another core feature of WordPress 3.2. The developers are focusing more on upgrading only the changed (updated) files instead of entire package.




  • New Theme – Twenty Eleven


And guess what, with the version release, new default theme has been release with this version, i.e Twenty Eleven. Twenty Eleven  is fully made in HTML5, and got more useful features.


twenty-eleven



If you want to upgrade to WordPress 3.2 do make sure your hosting provider is using PHP5 and MYSQL5 technology.

So don't wait, Wordpress 3.2 is officially released, so just go and download it.

For more features see the below video
httpv://www.youtube.com/watch?v=N3PbAxX1OsM

Jun 29, 2011

Warning: Missing required field "entry-title" | Missing required field "updated". | Missing required hCard "author".

Warning: Missing required field "entry-title" | Missing required field "updated". | Missing required hCard "author".
Warning: Missing required field "entry-title".
Warning: Missing required field "updated".
Warning: Missing required hCard "author".

Are you facing these errors while checking your rich snippets microformat?

Just add these following codes to your respective file and lines:-
For entry title:

[php]<h1 class="entry-title"><?php the_title();  ?></h1>[/php]
For update:
[php]<h2 class="updated"><?php the_date();?></h2>[/php]

For hcard author:
[php]Author:<p class="author"><span><?php the_author(); ?></span></p>[/php]

The above solution is for wordpress, for custom sites, just replace the code with your own code, like the_title will be replace with your page title etc.

Done, now you will see no warnings in testing your webpage on rich snippets testing tool

Jun 28, 2011

Wordpress showing blank white page | White screen of death

What! My wordpress Site Showing White Blank Page! No Errors !
Are you having this kind of problem ????
Don't panic, this is Wordpress White Screen Of Death
The name looks dangerous, but it is not,
Many times, mostly when transferring wordpress site from one hosting to another, people find that when running their website, they find wordpress is displaying White Blank Screen
This is caused because of damaged files in Wordpress.
The following are the solutions for it:-
[php]<ul>
<li>Reinstall Wordpress</li>
<li>Check wp-config file</li>
<li>Deactivate All plugins</li>
<li>Change the theme to default</li>
</ul>
<ol>[/php]

  • Reinstall the wordpress, just go to your file manager through FTP or cpanel and reinstall the wordpress manually by copy pasting files.(Before trying this try other steps)
    Remember Dont copy Wp-Content Folder.

  • WP-CONFIG.PHP check your wp-config file, it should start with[php]<?php[/php]

    and end with[php]?>[/php]

    their should be no space or blank line before and after it.

  • DEACTIVATE PLUGINS AND THEMES, just through your file manager, rename the folder of your plugin and themes to any other name in my case i used Plugins_temp and Themes_temp
    this deactivated all the plugins, and it made my theme to default Twenty-ten theme


Thats it you are done, these answer's will solve your problem,
Any problem persists, feel free to ask
Sharing is Caring

Wordpress-Add custom taxonomies tags to permalinks

Hello everyone, today we are going to discuss with you how to add wordpress custom taxonomies to permalinks.
You can refer custom taxonomies or taxonomies from here

Ok first of all, you need to register custom taxonomy with setting "rewrite=true", doing this will enable %custom_taxonomy_tag%
If you want to add custom taxonomies without coding, i prefer this plugin GD CPT tools

After doing all these things, you need to copy paste this function, to your theme's function.php file
[php]add_filter('post_link', 'taxo_permalink', 10, 3);
add_filter('post_type_link', 'taxo_permalink', 10, 3);

function taxo_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%taxo%') === FALSE) return $permalink;

//To Get post
$post = get_post($post_id);
if (!$post) return $permalink;

//To Get taxonomy terms
$terms = wp_get_object_terms($post->ID, 'taxo');
if (!is_wp_error($terms) &amp;&amp; !empty($terms) &amp;&amp; is_object($terms[0])) $taxonomy_slug = $terms[0]->slug;
else $taxonomy_slug = 'no-taxo';

return str_replace('%taxo%', $taxonomy_slug, $permalink);
}[/php]
Explanation
Line 5 – If the permalink does not contain the %taxo% tag, then we don’t need to translate anything.
Line 12 – Get the taxo terms related to the current post object.
Line 13 – Retrieve the slug value of the first taxo custom taxonomy object linked to the current post.
Line 14 – If no taxo terms are retrieved, then replace our taxo tag with the value no-taxo.
Line 16 – Replace the %taxo% tag with our custom taxonomy slug.

Now in wordpress, dashboard-settings-permalinks, you can write
[php]%postname%/%taxo%[/php]
This way you can add more custom taxonomies, just by adding more functions.
So Simple!!!!!!!

Configuring VPS | Moving wordpress from old hosting to new VPS | Part 2

Part 2:
As now, you have configured VPS, Now its time to move your old wordpress site to our new VPS(Which is already configured with LAMP). If you have not configured till yet, then it is my suggestion that you go back to my first tutorial
Configure VPS | Install LAMP on Centos VPS Part 1

So now lets begin the tutorial
As now, you know the basics on how to handle putty software and the ssh commands,
So lets start

First we will create the backup of the folder in your old server/hosting,
This is can be much easier through Cpanel, but if you don't have, then you have to enable the ssh by asking your hosting people.
Then connect to your old servers ssh and follow these steps


[php]cd public_html/your_directory_of _your_website_folder
tar -cvf foldername.tarcd /var/www/html
wget http://nirajmchauhan.blogspot/wordpress.tar
tar -xvf wordpress.tarcd /var/www/html
wget http://webstutorial.com/mysql.tar
tar -xvf mysql.tarmysql -u user -p dbname &lt; {path}/backup.sql[/php]

Remember your_directory_of _your_website_folder should be your wordpress folder and foldername.tar foldername will be the wordpress folder name, and your backup will be created in the name of that folder.

Now exit and connect to your new VPS, and follow these commands


[php]cd /var/www/html
wget http://nirajmchauhan.blogspot/wordpress.tar
tar -xvf wordpress.tar[/php]

In the first line we are giving the command to change the directory.
Second line, is used to download the compressed backup file from your old server.
REMEMBER:The URL and the back-up-file-name should be perfect, don't directly copy-paste mine
Third line is used to extract the backup

Till now we were successful to bring the wordpress to our new VPS, now we will bring the database of the wordpress.

The very first thing is to create the back-up of the wordpress mysql database, by logging into your old servers phpmyadmin, selecting the appropriate database and exporting that.
For this I ll suggest you to follow this link,
Backing up database

Now if you are ready with the mysql database backup, its time to bring it on our new VPS.



[php]cd /var/www/html
wget http:nirajmchauhan.blogspot.com/mysql.tar
tar -xvf mysql.tar[/php]

after extraction of database backup we will integrate it with phpmyadmin.
Before doing this, you have log in to new VPS php-my-admin window and create a new database, lets consider it as niraj

Sample of the code:

[php]mysql -u user -p dbname &lt; {path}/backup.sql[/php]
Actual Code:

[php]mysql -u root -p niraj &lt; /var/www/html/backup/niraj.sql[/php]
Just assuming my username to be root, my roots password to be password, niraj to be my new database in php-my-admin, which we created, and niraj.sql is the database sql file which we extracted before few steps.

Done,
You have successfully installed your old site to new VPS,
just after this you need to configure your wordpress wp-config file and add user to your php-my-admin for your database.
If any questions, feel free to ask

Happy coding

Configure VPS | Install LAMP on Centos VPS Part 1

Few days before when I had a VPS and needed to install wordpress, I found it very difficult because very few resources were available on google
So I am here now with my new post, On HOW TO INSTALL LAMP ON CENTOS
First buy an unmanaged VPS, and get ssh access
Then install Putty software in your computer, and start it
Then Follow the further steps
Start Putty software and then enter your IP for eg. 255.255.255.254
it will ask for username
generally its root and then enter the password
after that start typing the following code
IMPORTANT: IF YOU ARE NOT FAMILIAR WITH SSH COMMAND THEN BE CAREFUL. JUST COPY PASTE THE CODES.
First we will install yum

[php]
yum install -y yum-priorities

[/php]


After this we need to download updated repositories for php and mysql

[php]
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

[/php]


Then we will extract that by following command
code:

[php]

rpm -Uvh epel-release-5-4.noarch.rpm

rpm -Uvh remi-release-5.rpm

[/php]

After This we give priorities to repo and exclude php mysql and phpmyadmin from repository
code:

[php]

vi /etc/yum.repos.d/CentOS-Base.repo
[/php]

After this a file will be opened, press I from the keyboard to edit it, and after editing press esc button and type :x to save it
code:

[php]

priority=1
exclude=*php* *mysql* *phpmyadmin*

[/php]

Copy paste this above code five times before the following lines

[php]
#released updates
#packages used/produced in the build but not released
#additional packages that may be useful
#additional packages that extend functionality of existing packages
Copy paste the next lines before this line #contrib - packages by Centos Users

[/php]



[php]
priority=2
exclude=*php* *mysql* *phpmyadmin*

[/php]

Just one line above priority=2 their will be a line enabled=0 just make that to 1
After this press esc and type :x to save the file
Now same thing for epel and remi repository


[php]

vi /etc/yum.repos.d/epel.repo
[/php]

Just Above this line [epel-debuginfo] insert this code(inserting and saving is been explained on top)
Code:

[php]

priority=3

[/php]

Now after saving that, we will now edit the same code with just different filename
Code:

[php]

vi /etc/yum.repos.d/remi.repo

[/php]

And now in this, just above [remi-test] line, change the value of enable=0 to 1
and paste this code exactly above the [remi-test] line
Code:

[php]

priority=3

[/php]

Save it and now we will install apache web server,


[php]
yum install -y httpd

[/php]

After this we will install php,

[php]

yum install php

[/php]

During the installation it will prompt you for importing GPG key for the new repositories, just type y and press enter, this will be come for two times
Now we will start the Apache server
Code:

[php]

/etc/init.d/httpd start

[/php]

Just to test our Apache and php, we will create a phpinfo file


[php]

vi /var/www/html/info.php

[/php]

A new file will be created, insert this code into it, and then save it



[php]

<?
phpinfo();
?>

[/php]

Now in your browser, enter this URL, http://your IP or localhost/info.php
Now a PHP INFO file should open, where it will display php and servers information
if not then restart the apache server,
To restart the server,



[php]

/etc/init.d/httpd restart

[/php]

Now we will install MySql



[php]

yum install -y mysql-server mysql php-mysql

[/php]

Now the next code is used to configure Apache , to start MySql when server is rebooted.


[php]
chkconfig httpd on
chkconfig mysqld on

[/php]

Fire up MySql Server


[php]

/etc/init.d/mysqld start

[/php]

Now we will set the root password of mysql

Code:

[php]

mysql -u root password password
[/php]

Here the second password is the actual root password, you can change it with your's own.

Now its time to do last job, thats installing phpmyadmin



[php]

yum install -y phpmyadmin
[/php]

Now we have to edit phpMyAdmin config file to avoid the Forbidden Access Error



[php]

vi /etc/httpd/conf.d/phpMyAdmin.conf

[/php]

Search for a line,

[php]

deny from all# deny from all

[/php]

Comment the above line just by inserting # before the line, so after that, it should look like the following,

# deny from all

Save it and restart the Apache server

Code:

[php]

/etc/init.d/httpd restart

[/php]

Done
Now goto the browser and type this URL
http://IP or localhost/phpmyadmin
Now the page will appear, just enter username as root and password as password

Check my next post, Part-2, on how to transfer a wordpress site from existing hosting to your newly configured VPS
Feel free to give suggestions.