Wordpress Tutorials

Require Users To Login Before Viewing Post

Require Users To Login Before Viewing Post

Some of websites require login before viewing some pages to hide some important data from anonymous users. So if you also want to require users to login before viewing post in WordPress, here is the solution. Just copy the following code in functions.php file of your theme. Now open your theme’s single.php file and copy following code before get_header(); line like: Currently we have just two post ids to require …

Continue reading

Specific Post Types in Search Results

Specific Post Types in Search Results

As I have already showed you how to disable the search feature in WordPress and how to exclude pages from WordPress search results by modifying the functions.php file of theme. Now In this tutorial I will display specific post types in search results of WordPress by modifying in functions.php file. Just open your functions.php file of active theme and add the following codes: You can add any post types in …

Continue reading

Add Read More Link in WordPress

Add Read More Link in WordPress

When you use the_excerpt() in WordPress, it gives you auto-generated excerpt without shortcodes and tags. It’s default length is 55 words. The excerpt contains a ‘more’ tag at the end which by default is the […]. So in this tutorial I am showing you how to add Read More link in WordPress. Now open functions.php file of your theme and add following code: By default this link will not appear …

Continue reading

Change Post Excerpt Length in WordPress

Change Post Excerpt Length in WordPress

In this tutorial I am showing you how to change post excerpt length in WordPress according to your theme’s requirement. By default the excerpt length is set to return 55 words. If you want to change excerpt length, you can override this length in your theme by adding your own filter. For example if you want “70” words to display in your post except, to change post excerpt length add …

Continue reading

Disable the Search Feature in WordPress

Disable the Search Feature in WordPress

Sometimes the search feature becomes unnecessary, when you are using WordPress as a CMS. If you want to get rid of the search functionality of WordPress, here is the solution you can use. In this post I will show you how to disable the search feature in WordPress. Open your theme’s functions.php file and paste below code: This code will disable the search feature in WordPress and whenever the user …

Continue reading

Exclude Pages From WordPress Search Results

Exclude Pages From WordPress Search Results

WordPress Search feature displays published posts and pages in search results, by default. But when users search in a blog for something, it is most likely a post rather than a page. So in this tutorial, I will show you how to exclude pages from WordPress search results and make your search more relevant. Open your theme’s functions.php file and paste following code: This code searches for posts only through …

Continue reading

Change Post Thumbnail Size in WordPress

Change Post Thumbnail Size in WordPress

Today I am explaining some tricks to change post thumbnail size in WordPress theme. If you have enabled post thumbnail for your theme, you will get that default size of these thumbnails are not like as you want. If you want all of your post thumbnail to be same size in your theme, then you can set the size in functions.php file of that theme. If you want to have …

Continue reading

Important Tips For WordPress Beginner

Important Tips For WordPress Beginner

In these days WordPress is most commonly used open-source to make a simple websites, blogs and even e-commerce websites. WordPress is completely customizable and can be used for almost anything. There are thousands of themes and plugins available for WordPress. But sometimes WordPress beginner makes some basic mistakes, So today I am sharing some important tips for WordPress beginner that should be used before doing it online. 1. Use Permalinks …

Continue reading