database optimization and repair database if your database is corrupted database

How to optimize database?
Database Optimization
Repair Database if your database is corrupted

Database optimization is required to increase the speed of our application, however database optimization is not easy and we have to careful when we optimize any database.

if you are using the wordpress for your web-site then its really easy to optimize your wordpress database. as you know that wordpress is open source and there is lots of plugin which we need to install to get the functionality. same way there is one plugin named ‘Automatic Database Optimizing’ which you need to install and your database optimization will be done very quick and with accuracy.

Automatic Database Optimizing plugins also repair your database periodically, you just need to insert one line code in your wp-config.php which is located where you install wordpress blog. please insert below code at the end of the wp-config.php file.

if you forgot this and your database is corrupted then you can run the code manually as the file is located at /wp-admin/maint/repair.php. so if your site name is www.freelancephpdevelopment.com then you need to run the code like www.freelancephpdevelopment.com/wp-admin/maint/repair.php.

I Hope this will helpful to you.

how to add linkedin button in wordpress same like twitter sharebar_button wordpress, facebook sharebar_button wordpress and Google Plus sharebar_button wordpress

how to add linkedin button in wordpress?

WordPress provide many good plugins through which we can make our work easy, recently i am working on one project and in that we need sharebar button for social media. i get one plugin which is good an using that i get almost all well known social media but did not get linkedin share bar.
You can use the below code to get the twitter, facebook and google plus sharebar.

 
<?php sharebar_button('twitter','big'); ?>
<?php sharebar_button('facebook','big'); ?>
<?php sharebar_button('Google Plus','big'); ?>

There is not option like <?php sharebar_button(‘Linkedin’,’big’); ?> in the wordpress and because of that you can not add it via plugin, if you need to insert linkedin sharebar button then you need to insert it using the javascript code and its really very easy, just place below code next to all other social media code.

 
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-counter="top"></script>

register and comment in wordpress not comment without register wordpress

Recently, i am working with the wordpress and i want to allowed user to comments on the post or article if he/she is register. it means if user is not register then he/she can not comment on any article or any post in the wordpress. its wordpress inbuilt option but we are not aware of it, you can easily do this using the wordpress setting.

Go to Settings and then click on the Discussion which will open page of Discussion Settings in wordpress admin panel, now here there is option like ‘Users must be registered and logged in to comment’ with checkbox option. if you want user must register and then leave comments then you need to enable this by tick on the check box and save settings.

show user image in comments at wordpress post

how to show user image when user comment on the post in wordpress?

Today, i am working with the wordpress and i comment for one article but its not display the image with my comment, some time client need to display images with the comment and by default wordpress do not provide this facility. after some research i get the solution and its really very very easy. what you need to do is just install one plugin in your wordpress blog. plugin name is User Photo and link is http://wordpress.org/extend/plugins/user-photo/

One you install plugin then you need to go in settings then user photos where you get option for ‘Override Avatar with User Photo:’ you need to check the check box and save it. then enjoy it.

site compatible with iphone, ipad, Blackberry phone, iPodTouch, Android phone

website compatibility with iphone, ipad, Blackberry phone, iPodTouch, Android phone

When you are working with the custom php code than you can set the compatibility with iphone, ipad, blackberry phone, android phone and ipodtouch. but when you are working with the wordpress then its really difficult to set the compatibility for all phones browser, we have two option for this either we make two different blog for website and phone application. but now no need to make two different blog, there is one plugin which is manage it and if its open in the phone then make the site compatible to the phone application.

WPTouch plugin is the best wordpress plugin which is identify that website open in the computer browser or in the phone browser, also able to find the phone device and apply the theme which is compatible to that device. i waste one day behind this and then i get this plugin which is really excellent plugin and display all content in well format in phone device.

how to remove images from content of post in wordpress

WordPress is the best open source and very easy to install and set up on the site, when we working with the wordpress then its provide post content and page content and we can insert the images in the content using the editor. today i am working on project of my client and its in wordpress, if you aware of wordpress then you know that on the home page its show some post with the post title and post content. now issue is if there is a image in starting of post content then it will also show the image on the home page and because of that its looks messy page. now my client want to remove the images from the post content and display on the home page but in the single post page he need image as well. so i work on this and i get solution as well, below is the simple code which you can use to hide the images on the home page and you can use it to hide the inner page images as well if you want.

 
<?php
 
$original_content = get_the_content();
$new_content = preg_replace('/<img[^>]+./','', $original_content);
echo $new_content;
 
?>

Hope, it will be useful to you guys as well.

how to set alt tag in images of post content in wordpress

You are working with the wordpress and post many article in your wordpress blog, in some article you are using the images and you insert it in the post content, when you upload the images then its go to the media gallery and then you inset it post and set as feature image, google can not fetch the images directly in its list, we need to set the alt tag in the images and google can read the alt tag from the images and then index that image in its list. once the alt tag is set in the image than google get idea regarding the image and then its set it and display in the images when any user search images.

Now, you did not set the alt tag when you insert the images in the post content and now there are many post in the blog, so its not possible to edit it one by one and set the alt tag to the image. Don’t worry i implement very easy way to set the alt tag in all the missing images.

 
<?php
 
function add_alt_tags_to_images($post_content)
{
global $post;
$post_content = str_replace('alt=""','alt="'.$post-&gt;post_title.'"', $post_content);
return $post_content;
}
add_filter('the_content', 'add_alt_tags_to_images', 99999);
 
?>

You can put the above code in you function.php file which is in the theme folder of your wordpress blog. once you put this code in the function.php and run the blog then its set post title as the image alt tag in your site. Hope this will save your time and you enjoy it.

 

html editor for category description textarea in wordpress category

HTML Editor for Category Description Textarea.

HTML Editor for Tags Description Textarea.

HTML Editor for Taxonomies Description Textarea.

When you are working with the WordPress then you are aware that word press provide HTML editor to the post and page section only, WordPress do not provide the HTML editor for the category description, tag description or for any taxonomies description.

Rather then upload the editor externally on your site, you can use very easy way to get the html editor for the description fields of category, tags and taxonomies.

WordPress provide the ‘Rich Text Tags’ plugin which is easy to install, you just need to install it and no need to code any thing in the files. when you activate this plugin then its automatically apply on the category description text area.

Hope this save your time.