Tips for Best Practices in WordPress Development

How to log in a WordPress user programmatically

When you are building a WordPress based websites, it can be very useful to know how to programmatically log in a WordPress user. Here is a function that can do it easily.

Here is the function, drop it in your functions.php file:

Then, to log in a user, do the following:

How to Disable Google Fonts in WordPress

Google fonts are very more popluar, many developers employ it in WordPress theme,I have to say the WordPress dashboard also use google fonts.Now,there is a question that come in my head, how to disable google fonts in my WordPress?

Auto Login and Redirct to Custom page after WordPress Registration

If you want ro auto user login after registration and custom url for redirect after login, then use the below code snipats :

How to use PHP in WordPress widgets
Just add following snippet to your current theme’s functions.php file:

How to use shortcodes in WordPress sidebar widgets

I think you know it,shortcode is useful.But you may can’t use shortcode in sidebar widget.To allow shortcodes in sidebar widgets, simply edit the functions.php file from your them and add the following code:

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: ,