How can I make custom column with bootstrap v3 ?

It’s a easy way to make if you follow the bootstrap structure and use this code.

Here is the example of 5 columns.

HTML :

<div class="row">
    <div class="col-md-5ths col-xs-6">
        <span>This is column 1</span>
    </div>
    <div class="col-md-5ths col-xs-6">
        <span>This is column 2</span>
    </div>
    <div class="col-md-5ths col-xs-6">
        <span>This is column 3</span>
    </div>
    <div class="col-md-5ths col-xs-6">
        <span>This is column 4</span>
    </div>
    <div class="col-md-5ths col-xs-6">
        <span>This is column 5</span>
    </div>
</div>

CSS:

.col-xs-5ths,
.col-sm-5ths,
.col-md-5ths,
.col-lg-5ths {
    position: relative;
    min-height: 1px;
    padding-right: 10px;
    padding-left: 10px;
}

.col-xs-5ths {
    width: 20%;
    float: left;
}
@media (min-width: 768px) {
.col-sm-5ths {
        width: 20%;
        float: left;
    }
}
@media (min-width: 992px) {
    .col-md-5ths {
        width: 20%;
        float: left;
    }
}
@media (min-width: 1200px) {
    .col-lg-5ths {
        width: 20%;
        float: left;
    }
}

Bluehost and Hostgator server isn’t working with Contact Form 7 plugins.

Bluehost server is functional so it’s normally will be not work with contact form 7 plugins for wordpress. We need to configure it. It’ll be work all type of mail example (gmail, yahoo, yourdomain@com).

Step #1: Install your Contact form7 plugins.

Step#2: Install WP Mail SMTP plugins for working.

Step#3: You need to configure it -> Go to Settings -> Email ->

From Email: admin@deshisoft.com (Example)

From Name: deshisoft (Example)

Mailer: Send all WordPress emails via SMTP.

Encryption:

Authentication:

Username: Your hosting user name (cpanel user)

Password: Your hosting password (cpanel pass)

Send a Test Email: admin@deshisoft.com (Example)

Some Server isn’t working by this method (example: hostgator). So you need to follow another way if above the way is useless-

SMTP -> ERROR: Failed to connect to server: Connection refused (111)
SMTP Error: Could not connect to SMTP host.

I change the port 587 with TLS encryption protocol.

If it’s still this type of error please try this way:

Problem: contact form 7 confirms message has been successful, however message is not received with website hosting email address !!!!

nside the plug in directory for contact form 7, use your FTP program
go to: /includes/classes.php
edit as per below
original:
$headers = “From: $sender\n”;
change to
//$headers = “From $sender\n”;

Emails that are being sent from your website are showing up in users inbox as “WordPress@domain.com” you want like to change it from “wordpress@” to “somethingelse@domain.com.”

Solution:

Use a filter, added to functions.php of your theme:

example:

//notification mail email change
add_filter('wp_mail_from','custom_email_from');
function custom_email_from($mail) {
$mail = 'somethingelse@domain.com';
return $mail;
}
//notification name change; optional
add_filter('wp_mail_from_name','custom_email_from_name');
function custom_email_from_name($name) {
$name = get_bloginfo('wpurl');//or put your own text here
return $name;
}

That’s all

Next steps: tips and resources

Section 7. Next steps: tips and resources

Tips for common tasks

We have covered the basics. Where you go from here is up to you. You know enough
now to implement some of these useful tasks:

User database
You could implement a user database. You can add a login feature to this.
News
You could code a section that always displays the latest news or maybe a “What’s
new” section that’s automatically generated. The TABLE could be something like:

CREATE TABLE news
(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(40),
newsbody TEXT,
news_date DATE,
PRIMARY KEY (id),
UNIQUE id (id)
);

And assuming you want to automatically show the title of the latest five news
items, the code could be something like:

<HTML>
<?php
$sql="SELECT * FROM news ORDER by news_date DESC";
$db = mysql_connect("localhost", "root", "");
mysql_select_db("newsdb",$db);
$result = mysql_query($sql,$db);
echo "Latest News:<br>";
$i=1;
while ($myrow = mysql_fetch_array($result))
{
echo "<a
/a><br>";
$i=$i+1;
if($i>5)
break;
}
?>
</HTML>

Product database

You could create a detailed database of your products. Clients could see all the
products or search for particular product.

Resources

You’ll find useful information for further study at these sites:

PHP site
At this official PHP site, you will find PHP source as well as compiled binaries for
both Linux and Windows. You will also find documentation and some useful links
to various PHP sites, including a list of hosting providers that support PHP.

MySQL site
Here you’ll find news, downloads, training information, documentation, and also
job information.

Apache Software Foundation site
The Apache Software Foundation has created some of the best open source
software projects. One of them is the Apache Web Server, which is currently the
most popular Web server on the net.

PHPBuilder site
This is a must-visit resource site for PHP developers. You will find code, tips,
discussion forums, news, jobs, links, and all sorts of useful stuff.

Your feedback

Please let us know whether this tutorial was helpful to you and how we could make it better. We’d also like to hear about other tutorial topics you’d like to see covered. Thanks!

Equal Height Columns

Many solution for this – Try you best.

Simple CSS trick for equal height columns:

Way 1:

Solution:

Two column layout design and you want the height of the sidebar column is equal to the height of the main content column.

The following screenshot  problem:

Example: Two columns layout like this:

HTML structure:

<div id="wrapper">
<div id="maincontent">...</div>
<div id="sidebar">...</div>
</div>

CSS:

<style type="text/css">
	#wrapper{
		margin:0 auto;
		width:600px;
	}
	#maincontent{
		border-right:solid 200px #DFDFDF;
		position:absolute;
		width:400px;
		background:#ccc;
	}
	#sidebar{
		background:#DFDFDF;
		margin-left:400px;
		position:absolute;
		width:200px;
	}
</style>

Way 2

Jquery trick for equal height box columns:

Problem:

Solution:

Three Box layout design and you want the height of the Box is equal to the height of the parent div box.

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){

	var h = $('#parent_div').height();
 	$('.child_div').height(h);

});
</script>

HTML:

<div id="parent_div">
  <div class="child_div"> BOX1  </div>
  <div class="child_div"> BOX2</div>
    <div class="child_div">BOX#3</div>
</div>

CSS:

#parent_div{ overflow:hidden; width:100%; }
	.child_div{
		border:1px solid red;
		float:left;
		width:28%;
		margin:0 1%;
		padding:1%;
	}

How to build a wordpress plugin using easy way?

Plugin Development:

In this tutorial, I will show how to build a “Hello World” which  is very easy,  you need to understand basic knowledge of php.

Before we move on the coding for plugin you should chose a unique name to your plugin so that’s no problem with other plugins name.

Plugin Files & Names

Assigning unique names, documenting and organizing the plugin files is very important part of plugin creation.

Although wordpress allows you to place the plugin php file directly into the wp-content/plugins folder, for a good plugin developer you will need to create a folder named hello-world and within place readme.txt and hello-world.php.

The readme.txt contains information about your plugin and can come in handy when you submit your plugin wordpress SVN plugin repository. See the readme sample.

Go ahead and create these files and we will add the content to these files later.

The Plugin Basics

The heart of a wordpress plugins is the below 2 functions (commonly called `hooks`)

add_action ($tag, $func) documentation
add_filter ($tag,$func) documentation

It is very important to know the difference between the above functions.

  • add_action –> does an action at various points of wordpress execution
  • add_filter –> does filtering the data (eg. escaping quotes before mysql insert, or during output to browser.

Refer to the WordPress Plugin API for more better understanding.

Plugin Information

Open your hello-world.php and in the first line, add this commented plugin information to your file.

<?php
/*
Plugin Name: Hello-World
Plugin URI: http://yourdomain.com/
Description: A simple hello world wordpress plugin
Version: 1.0
Author: yourname
Author URI: http://yourdomain.com
License: GPL
*/
?>

Save this php file,

  • Place the plugin folder to wordpress > wp-content > plugins,
  • Go to your wordpress admin > plugins and you will see the new plugin listed, waiting to get activated.

simple ain’t it?

But this plugin had to do something right?

Why not we make it print  “Hello World” when we call it from wordpress theme template files.

for that we write the code using add_action below the commented plugin information in the hello-world.php

<?php
/*
Plugin Name: Hello-World
Plugin URI: http://yourdomain.com/
Description: A simple hello world wordpress plugin
Version: 1.0
Author: Balakrishnan
Author URI: http://yourdomain.com
License: GPL
*/
/* This calls hello_world() function when wordpress initializes.*/
/* Note that the hello_world doesnt have brackets.
add_action('init','hello_world');
function hello_world()
{
echo "Hello World";
}
?>

Thats it! Our Hello World plugin is nearly done and with just few lines of code. When our plugin is activated, add_action command calls our hello_world() function when wordpress starts loading.

Lets Test our Hello World Plugin

We really dont know whether our plugin works or not. To test our plugin, go to plugins, activate the hello-world plugin.

Then open your worldpress theme wp-content > themes > default, open any of index.php, archive.php or single.php and place the following code anywhere.

<?php
if(function_exists('hello_world')) {
hello_world();
}
?>

The key here is function_exists() call which checks whether plugin loaded or not and then allows the hook into the plugin function.  Call to hello_world() in the theme files without checking it, often leads to “Fatal error: call to undefined function” and our blog would crash, if the hello world plugin is not activated or deleted.

If you carefully notice above graphic, see how the hello world appears. Thats the work of our plugin. It WORKS!

Lets take our plugin one step further!

Why not, we build a plugin options page in admin area and provide a backend for plugin users?

Right now, the plugin outputs hello world (its pretty much static) and if somebody wants to output ‘Hello Example’, they need to open the php file and make changes everytime to print different text.

Asking the user to edit plugin files isnt a good idea!  As a wordpress plugin developer, it is you, who has to provide a good wordpress options interface in the wp-admin area.

Writing Plugin Options Page

We now create  Hello World options page in the wordpress admin area.

Here is what we do….

  • When plugin gets activated, we create new database field `wp_hello_world_data` using set_options() function.
  • When plugin gets deactivated, we delete the database field `wp_hello_world_data`
  • We create a options menu for Hello World in WordPress Admin > Settings.
  • We save the user entered data in the wordpress database.
  • We retrieve the data stored in wordpress database and output it using get_options() function.

Why we are creating database field? because the saved data must be saved somewhere? ie. in wordpress database. This way the plugin outputs user entered text, instead of the static “Hello World”.

Activating/Deactivating Plugin

It is very easy to write a function on what plugin does, when it gets activated. WordPress offers 4 very important functions

<?php
/* Runs when plugin is activated */
register_activation_hook(__FILE__,'hello_world_install'); 

/* Runs on plugin deactivation*/
register_deactivation_hook( __FILE__, 'hello_world_remove' );

function hello_world_install() {
/* Creates new database field */
add_option("hello_world_data", 'Default', '', 'yes');
}

function hello_world_remove() {
/* Deletes the database field */
delete_option('hello_world_data');
}

?>

The above code creates the new database field `hello_world_data` using add_options and it runs when we activate the plugin. It has the value ‘default’ since we explicitly define it.

Similarly when the plugin gets deactivated or removed, we need to clean up things, so we remove the created database field using delete_option.

Plugin Settings Page

This is our final step.  All we need to create is plugin settings page in the wordpress admin area.  The settings page will update and save the data to the database field `hello_world_data` which we created while activating the plugin. Be sure to checkout creating options page in wordpress codex.

Here is a very important thing to remember:

The add_action for admin_menu should call a function hello_world_admin_menu() containing add_options_page, which in turn should call a function hello_world_html_code() containing html code. This is how the code should flow! Refer to wordpress administration menus

<?php
if ( is_admin() ){

/* Call the html code */
add_action('admin_menu', 'hello_world_admin_menu');

function hello_world_admin_menu() {
add_options_page('Hello World', 'Hello World', 'administrator',
'hello-world', 'hello_world_html_page');
}
}
?>

The above code, is placed under is_admin() which means it only runs in the wordpress admin area.

The below function has the html code for the settings page, containing the form and notice how the php tag is split to accomodate the html code.

and the coding part is..

<?php
function hello_world_html_page() {
?>
<div>
<h2>Hello World Options</h2>

<form method="post" action="options.php">
<?php wp_nonce_field('update-options'); ?>

<table width="510">
<tr valign="top">
<th width="92" scope="row">Enter Text</th>
<td width="406">
<input name="hello_world_data" type="text" id="hello_world_data"
value="<?php echo get_option('hello_world_data'); ?>" />
(ex. Hello World)</td>
</tr>
</table>

<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="hello_world_data" />

<p>
<input type="submit" value="<?php _e('Save Changes') ?>" />
</p>

</form>
</div>
<?php
}
?>

You must remember 2 things in the above code.

1. Specify the database field we created before in the input text box as ‘hello_world_data’

<input name="hello_world_data" type="text" id="hello_world_data"
value="<?php echo get_option('hello_world_data'); ?>" />

2. If your form has number of fields (like textbox, selectbox etc), all those should be listed in the value field of page_options, separated by commas. For more information, refer to wordpress documentation

<input type="hidden" name="page_options" value="hello_world_data" />

Now, the plugin outputs whatever the user specifies in the hello world settings page.

Thats it! Our plugin is READY!

Dont forget to add documentation to readme.txt.

Enjoy! (collected from internet and modify for user friendly)

How can we use Google web master tools with sitemap and verify?

Step# 1: Need to sign in Google web master tools then you will be the add option on the top of right sidebar.

Step#2: When add the site you need to verify it. Please follow the step under the screenshot. At first you need to download it instruction (1) and upload it on your site document root tree. When upload is finish you need to check it for successfully visiting link see the instruction (3). If it’s okay then click to  VERIFY  button.

Step#3: Now go to install wordpress plugin http://wordpress.org/extend/plugins/google-sitemap-generator/

When you click the link your sitemap.xml will be automatically generate on your site. Now you need to back your google web master tools for add the name.

N.B. – You can check it on your site for working purpose.  www.yoursitename.com/sitemap.xml

Step#4: Now we need to add the name of sitemap.xml in our google web master tools.

Where we’ll write the sitemap.xml file name on your google web master tools?

Click your google web master tools Dashbord then you’ll see the sitemap option on the right sidebar. Just click on it for upload your sitemap.xml file.

 

Download: How can we use Google web master tools with site

How to use Twitter Widgets

Twitter has super-sweet widgets to display your Tweets anywhere on the web. You can also create a custom widget with Tweets from the sources of your choosing!

How To Add a Twitter Widget To Your Website

Access widgets from the Resources link in the footer of all Twitter web pages. To add a Twitter widget to your social network, website, or blog:

  1. Log into Twitter
  2. Click Resources at the bottom of the details pane on the right hand side of your screen.
  3. Select See all Widgets
  4. Select My Website
  5. Select the widget that shows the Tweets you’d most like to display on your website:

  • Profile Widgets display recent Tweets from a specific user.
  • Search Widgets display highly customizable search results in real time (perfect for live events, conferences, brands etc.)
  • Faves Widgets will show all the Tweets you have marked as Favorite
  • List Widgets show off a list of users you’ve curated. Great for showing off a subset of interesting folks’ Tweets.

Adding Profile Widgets

Profile widgets display the public Tweets of anyone on Twitter. Try entering a few user names to test it out!

  1. Enter the name of the user whose tweets should display in the widget.
  2. Click Appearance to change the colors of your widget (You can enter the numeric color codes to perfectly match your website or blog!)
  3. Click Dimensions to change the size of your widget (You wont be able to preview the size in the widgets page.)
  4. Click Test settings to make sure everything looks right
  5. Click Finish & Grab Code at the bottom of the page, and add the code to your website.

Once you’ve added the widget code to your site, voila! You’ve got Tweets!

Adding Search Widgets

Customize your Twitter Search Widget using the three left hand tabs on the widget screen: Settings, Appearance and Dimensions. Note: search widgets will not work on Facebook.

  1. Fill out the settings for your widget: the Search Query field determines the display of the real-time search results. This can be something as simple as San Francisco, or you can experiment with advanced search queries.
  2. Decide whether or not to loop old results (Recommended only for low volume (very specific) queries!)
  3. Click Appearance to change the colors of your widget (You can enter the numeric color codes to perfectly match your website or blog!)
  4. Click Dimensions to change the size of your widget (Customize the Width (px) and Height (px) of your widget to fit the area of the page where you want it (minimum size is 150px wide and 100px high). You wont be able to preview the size.)
  5. Click Test settings to make sure everything looks right
  6. Click Finish & Grab Code at the bottom of the page, and add the code to your website.
  7. Add the code to your website and display real time Tweets!

Adding Faves Widgets

  1. Enter the name of the user whose Tweets should display in the widget.
  2. Click Appearance to change the colors of your widget (You can enter the numeric color codes to perfectly match your website or blog!)
  3. Click Dimensions to change the size of your widget (You wont be able to preview the size in the widgets page.)
  4. Click Test settings to make sure everything looks right
  5. Click Finish & Grab Code at the bottom of the page, and add the code to your website

Adding List Widgets

  1. Enter the name of the user whose tweets should display in the widget.
  2. Click Find Lists to select the list you’d like to populate your widget (the drop-down to select from appears below the username).
  3. Click Appearance to change the colors of your widget (You can enter the numeric color codes to perfectly match your website or blog!)
  4. Click Dimensions to change the size of your widget (You wont be able to preview the size in the widgets page.)
  5. Click Test settings to make sure everything looks right
  6. Click Finish & Grab Code at the bottom of the page, and add the code to your website.

Ref: https://support.twitter.com/groups/31-twitter-basics/topics/112-linking-to-your-blog-or-website/articles/15354-how-to-use-twitter-widgets#