Tag: functions.php

Removing billing fields from Woocommerce checkout page

Woocommerce plugin for WordPress, is the easiest way to start selling your products online. It handles many different payment options, gateways, tax calculations, shipments and even stock tracking. All you need is installing the plugin and start adding your products. While plugin has many great features, for a shop with only downloadable products, you won’t […]

Shortcode to display content for Mobile or Desktop visitors only

Did you know that WordPress has a mobile detect function already. In this post we will show you how you can use wp_is_mobile function to create a simple shortcode to hide certain parts of your posts from mobile visitors or the other way.

How to redirect 404 hits to your blog home page

A regular website, gets about 10-15% not found hits in a month. If you can’t handle those hits in a good way, visitors will leave your site with dissapointment. Of course, a custom, well organised 404 page is the best way to handle them, but you can also redirect them to your home page for […]

HowTo: Find out which template is used by WP

Templating is a great feature of WordPress blogging system. If you want to build a CMS system using WordPress, you will be using lots of them. You can use different templates for each category, tag, page, etc. But sometimes this gets confusing. In this post I will give you a simple snippet to find out […]

HowTo: Replace WordPress self hosted jQuery with Google jQuery

If your hosting server is not fast enough, you may want to replace your self-hosted #jquery with google cdn hosted jquery. You may think that you are not using that script anyways, but most of your #plugins do.

HowTo: Change number of posts displayed on Search

WordPress usually use a constant number of posts for all your category pages, index, and also search results pages. For search pages, 10 posts are not usually enough. To change this behaviour, a simple query filter will do the trick.

Add browser classes to body using filters in WordPress

Wordpres adds custom classes to <body> depending on the page you are viewing. This is a great function that can be used for styling your theme. Here i will show you how to add body classes depending on the browser your visitor is using. So you can style your theme layout using those classes.

WP Trick : Display most viewed posts first on search pages

Wordpress by default shows latest posts first on archive and search pages. Here I will show you how to display search results using post view counts.

How to make auto-embedded videos obey z-index

WordPress allows you to embed videos so easily using oEmbed. You can easily add videos to your post just pasting their URL to your post. WordPress handles all the object and embed HTML for you. But this code is missing wmode parameter which is necessary for CSS z-index to work.

How to exclude categories and tags from your widgets

Sometimes you may need to hide certain tags and categories from your widgets. In this post, I will explain you how to filter out unwanted terms using wordpress filters.

How to display a “Back to parent” link on your blog pages

For a better seo, and a better user experience, you can easily add a “Back to parent” link on your pages. In this post i will show you how to add it to your page templates.

How to display latest tweet on your site

To display your latest tweet on your site just add the following function in your functions.php file.