Programming-6

How To Have WordPress Pagination In Your Website Without The Use Of Any Plugins

Without any second thought, WP-PageNavi is one such plugin which everyone knows well, which everyone love very much and which everyone wants to get installed in their WordPress website. But, certainly, just like our other snippets tips, for this also, we are having something for you. It’s pretty simple, on copying and pasting the following snippet in your WordPress website, you will be able to have the pagination active and that too without the use of any plugin.

Snippet Source/Credit: Smashing Magazine

How To Prevent WordPress To Compress Your JPG Files

By default, WordPress compress upload jpg image files. While it is a good practice but sometimes, you need not such things. To prevent this, all you have to do is to copy and paste the following snippet in your theme’s functions.php file and it will let you prevent WordPress to compress your jpg files.

Snippet Source/Credit: WP Snippets

How To Make Your Search Results Unlimited

By default, WordPress displays ten posts on the search result page while there are some from us, who wish to see unlimited number of search results on the same page. Putting the following snippet in your theme’s search.php, you will be able to do so. Start by finding the below code in your search.php file:

Once you found it, simply replace it with:

Snippet Source/Credit: WPHacks

How To Redirect Users To A Random Post

You do often wish that what will happen if there is something by which you will be able to redirect users to a random post. Are you? If yes, then let’s make your job easy here, pasting the following snippet to your page-random.php file will let you redirect users to a random post.

Snippet Source/Credit: Smashing Magazine

How To Change The Label In Your WordPress Blog

It is pretty much common that you want to customize the label of certain things, say “post” label to “article” in your WordPress blog. It can be done with just few lines of code, just simply copy and paste the following snippet in your theme’s functions.php file and you are done.

Snippet Source/Credit: Smashing Magazine

How To Speed Up Your Blog By Adding Caching Custom Queries

If you are looking onto a method by which you can speed up your WordPress blog, then this is one such which you have to definitely try. All you have to do is add caching custom queries in your blog and you will be able to speed up your website.

Snippet Source/Credit: WordPress Codex

How To Create A Dropdown Menu Of Tags

By default, WordPress offers dropdown menu of categories (through wp_ dropdown_categories() function). But, what if you will be requiring or wish to display your tags in a dropdown manner as well. Does it sound good? Yes, then simply paste the following code at the place where you want the dropdown menu to be displayed. Make sure to modify the code on line 5 as per your requirements.

Snippet Source/Credit: WPLover

How To Test Whether A Plugin Is Active Or Not

For one-to-many times, you did often considerably think over the context that what it takes exactly from the backend which says that whether a plugin is active or not. Well, if you too found yourself in such a situation and don’t know what solution to opt for, then all you have to do is to simply paste the following code below and it will let you know that whether a specific plugin is active or not.

Snippet Credit/Source: CatsWhoCode