PurabTech is technical blog for Programmer and Coders
Author: Purab
I am Purab from India, Software development is my profession and teaching is my passion.
Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks.
Purab's Github Repo
Youtube Chanel Video Tutorials
Connect to on LinkedIn
WordPress tutorial, add custom fields to user profile wordpress without plugin. For adding extra details use can use following sample code in functions.php file. You can modify the code as per your requirement.
add custom fields to user profile wordpress without plugin
add custom fields to user profile wordpress without plugin
Note: If you are not wordpress developer then you should ask any wordpress developer to do this changes.
add_action( 'show_user_profile', 'extra_fields_to_user' );
add_action( 'edit_user_profile', 'extra_fields_to_user' );
function extra_fields_to_user( $user ) { ?>
<h3>Extra profile information</h3>
<table>
<tr>
<th><label for="facebook">facebook</label></th>
<td>
<input type="text" name="facebook" id="facebook" value="<?php echo esc_attr( get_the_author_meta( 'facebook', $user->ID ) ); ?>" /><br />
<span>Please enter your facebook username.</span>
</td>
</tr>
</table>
<?php }
add_action( 'personal_options_update', 'extra_fields_to_user_save' );
add_action( 'edit_user_profile_update', 'extra_fields_to_user_save' );
function extra_fields_to_user_save( $user_id ) {
if ( !current_user_can( 'edit_user', $user_id ) )
return false;
/* Copy and paste this line for additional fields. Make sure to change 'facebook' to the field ID. */
update_usermeta( $user_id, 'facebook', $_POST['facebook'] );
}
showing the user information use following code.
<?php the_author_meta( ‘facebook’ ); ?>
WordPress tutorial, Display wordpress Tags In Dropdown Menu without plugin. we given simple code here which you need to put in theme functions.php file.
If you want to display the tags in drop down menu then use following code in functions.php file.
Display wordpress Tags In Dropdown Menu without plugin
If you want to hide the wordpress editor from admin panel then you can use the following code in functions.php file. This is achieved with very simple css trick. You just need to add the following hook into your functions.php file which you can find in your wordpress theme folder.
you can do this in two ways. First with using admin panel. First thing you need to do is login to your WordPress admin panel.
Then you would need to go to Users > Your Profile,
Just disable visual editor checkbox. That sit. But if you want to this setting to done for all wordpress users then you can use following code.
How to hide wordpress visual editor and HTML editor
How to hide wordpress visual editor and HTML editor
you just need add following code into your functions.php file. This file you can find in your wordpress theme folder.
WordPress tutorial, how to display your posts words count in wordpress. Here in this article we given code for adding in your theme functions.php file.
how to display your posts words count in wordpress
how to display your posts words count in wordpress
If you want to display the words count in your post. you should use the following code in functions.php file.
If you are not wordpress developer then dont use this code in your theme files.
wordpress tutorial for, change Visual Editor Font Size without wordpress plugin. need to open your functions.php file and put following code in that file.
change Visual Editor Font Size without wordpress plugin
change Visual Editor Font Size without wordpress plugin
You need to open your functions.php file and put following code in that file.using following code you can change the font size of editor.
Note: If you are not having knowledge of wordpress code and php then dont use the code.
wordpress tutorial, how to show author in wordpress post. Many people want to read the author information after the article. This is good for seo also.
how to show author in wordpress post
You can show the author information in single page using following code. just open your single.php file and put following code after the the_content() function.
For developers wordpress moving site to new server is daily job. wp migration is easy with mysql query. Here is useful mysql queries for wordpress migration. This mysql query are very useful for moving wordpress data to new server.
Note: before executing following queries, first take backup of wordpress database first. it is very important for safety and backup purpose. I recommend, always take database backup while doing any database operation. Taking database backup is good practice.
When you want to change your domain name for wordpress site. You need to first take backup of your file system and mysql database. Make sure that backup is completely taken. Verify with any wordpress developer. Then only you start the migration. For wordpress domain migration following mysql queries are required.
mysql queries for wordpress migration
I already written detail article for this. You should read following article.
When you creating site in wordpress, I created unique checklist for self hosted wordpress sites. checklist for self hosted wordpress sites is very important.
checklist for self hosted wordpress sites
When you creating the website in wordpress that time you need to be very careful and you need think and check about following things. I created the checklist for wordpress sites.
About Theme
Use the Minimum images
checklist for self hosted wordpress sites
You should use the sprite image in wordpress theme. That will reduce the webpage loading time.
Use proper and optimized CSS properties
You should use the proper CSS. Dont repeat CSS code. like float, color, margin.
Test the Theme in IE7, IE8 ,Firefox, Safari and Google Chrome
Your theme need to be cross browser compatible.
Use only External CSS
Dont use the inline CSS in Theme.
Use Jquery
Jquery is very popular and simple and seo friendly for wordpress site.
Use the Sidebars in your theme
In sidebar you mostly put the links and ads. That is very important for SEO.
Put the Tag and category links
You should put the tags and category links in theme.
Make Mobile friendly
You theme should viewable in iPhone, iPad, Blackberry mobile devices.
Check in WordPress site
Check Robots.txt file
Put Site title
Get some good Tagline for the site
Create contact us email address
Put Share links ie. Twitter, Facebook, MySpace, RSS, LinkedIn etc.
Create Author’s profile: Email, Website, AIM, Biographical Info
Put the Google Analytics code in your site
Do web master varification
Use the SEO Meta Tags (Use the SEO Meta Tags plugin)
Submit your site to to Yahoo, Google, Bing
Use good wordpress plugins
Use the Permalinks (date and name. if do not want to show category in url then use ‘No Category Base’ plugin)
All Posts and Pages with genuine and useful articles
Create nice Categories and their structure (parent-child)
Remove broken urls (if urls not provided use ‘javascript:;’ in anchor’s href)
Use the Widgets and Menus with their urls
Put Akismet API key -For Spam protection.
Do setting for Media sizes (thumbnail, medium, large)
Uncheck the “Organize my uploads into month- and year-based folders” setting in media setting.
Use the SEO ultimate plugin.
Dont use the plugin for contact form
Here are some useful links which will be helpful to you
Tips for Bloggers, wordpress visual editor keyboard shortcuts for bloggers, In wordpress admin panel and with new post option we can use keyboard shortcuts also.
wordpress visual editor keyboard shortcuts for bloggers
Here is list of keyboard shortcuts for wordpress editor for admin panel. wordpress shortcuts are available from wordpress 2.6 version and that is still there. But in current versions of wordpress you cannot see the hotlinks but you can use that for fast blogging.
Alt+Shift+A : Hyperlink Selected Text.
Alt+Shift+T : Add read more Tag to post.
Ctrl+[Header Number] : Used to apply header tag to current line.
Alt+Shift+L/R/C : Align Left/ Right / Center.
Alt+Shift+S : Justify Text.
Alt+Shift+D : Strike through Text.
Alt+Shift+U : Start unordered list
Alt+Shift+O : Start an ordered list.
Alt+Shift+P : Add a new page to your post.
Alt+Shift+Q : Enter a blockquote.
Alt+Shift+H : Toggle Full Screen.
The visual editor has several keyboard shortcuts, or hotkeys, built in.
wordpress visual editor keyboard shortcuts for bloggers