Tips for Best Practices in WordPress Development

Prem Tiwari - - WordPress Snippets

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:

Prem Tiwari

Prem Tiwari is the founder of and also a professional developer and a blogger by hobby.

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.