Allowing users to navigate throughout your site from post to post makes for longer browsing time on the site. You can display related posts at the end of the post in WordPress so your visitors more engaged with your site and you get a chance that they will convert into a lead or a sale. So in this post I will tech you how to display related posts in WordPress …
Wordpress Tutorials
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 …
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 …
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 …
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 …
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 …
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 …
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 …