WordPress blog is one of the most popular open source and easy to install and configure. Recently, we all friends meet for New Year party. My friend has his own blogs and web-sites. He asks me for one issue he is facing in his blog since long time.
Published date of post change automatically in wordpress.
Post date changed automatically in wordpress.
Automatically changed published article dates.
When I ask for few more details than he said may be possible that this issue arise after he upgrade wordpress version. I took admin panel details to work out this issue of automatically change published date in wordpress.
Please do the following steps if your articles published date change automatically.
- Check in the installed plugin and search for plugin named ‘SEO SearchTerm 2’.
- If ‘SEO SearchTerms 2’ plugin installed in your blog than go to Settings.
- Go for ‘SEO SearchTerms 2’ Settings.
- Search for ‘Promote old post with no search engine traffic’.
- It will be Yes, Turn it off and save it.
That’s it. Now its not going to change published date automatically. Basically, this plugin re-post the articles which are not indexed in the google search. One way its really good for google search but your visitor does not get latest content if it’s turned on.
How to optimize database?
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?
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'); ?>
<script type="IN/Share" data-counter="top"></script>
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.
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.
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.
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.
$original_content = get_the_content();
$new_content = preg_replace('/<img[^>]+./','', $original_content);
Hope, it will be useful to you guys as well.
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.
$post_content = str_replace('alt=""','alt="'.$post->post_title.'"', $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.
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.
wp-admin not redirect on login page when you open it or if you direct open wp-login.php file and insert username and password then its not redirect on dashboard after login. I get this redirection issue and spend lots of time behind it. finally i know why this issue arise.
When you work with the function.php file of your theme folder and making custom menu or custom post and suddenly you get the issue in your blog and not able to access the wp-admin. it does not mean that you did wrong code in your function file. In the word press admin panel there are many header set to redirect on the another page, like once you login using correct username and password then you redirect on the dashboard. but if there is any space before the header statement then you can not redirect on any page and its give error as below.
Warning: Cannot modify header information – headers already sent by (output started at /home1/modernh6/public_html/wp-content/themes/carrington-text/functions/sidebars.php:36) in /home1/modernh6/public_html/wp-includes/pluggable.php on line 865
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-admin\install.php on line 36
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-login.php on line 255
Warning: Cannot modify header information – headers already sent by (output started at /home1/modernh6/public_html/wp-content/themes/carrington-text/functions/sidebars.php:36) in /home1/modernh6/public_html/wp-includes/pluggable.php on line 662
if you look the error like above then its does not mean that error in the install.php,wp-login.php or in pluggable.php.
This is very minor issue with the space, if you look your code carefully then there is white space and because of that server count its as output started and do not redirect you on the target page and give this error.
Hope this will be helpful to you.