Introduction to Advanced analytics (part 1)

This is a a series of articles which is supposed to help a beginner, setup advanced tracking tools that will help him gather more information about the way visitors are interacting with a website. We are going to focus mostly on Google tools, because they are free, easily accessible for everyone and reliable. When using free tools you need to keep in mind that there will be a few limitations, especially when working with websites with a lot of traffic, but this shouldn’t be an issue for most beginner users. The first part of this series is describing steps needed to make your website...

Disable WordPress theme changing

You’ve probably spent a lot of hours customizing the site’s theme, maybe even built it from the ground up to meet your client’s very specific needs. Either way, if you client swapped the theme it could spell disaster. Luckily, there’s another handy code snippet you can use to remove the “Themes” menu item under “Appearances” in the admin sidebar. Just add this code to your functions.php file: This code will hide the Themes sub-menu from all users other than user ID 1, who is usually the person who setup the site. This allows only the site’s creator to edit the site without...

PHP functions for WordPress

Below you can find a list of source code snippets for very useful PHP functions for wordpress. You can use each one of the following parts of source code in your functions.php file: How to Increase or Decrease WordPress JPEG Image Compression WordPress does automatically compress JPEG images at 90% quality. In this article, we will show you how to increase or decrease WordPress JPEG image compression. All you need to do is paste the following code in your theme’s functions.php file or your site-specific plugin. Setting it to 100 would mean that WordPress would compress the image at its...

WordPress logo

Retrieve and get WordPress post ID outside the loop

Outside the Loop or out of the context of the post, such as in the header or the footer and even sidebar area in WordPress templates, the_ID() cannot be used as a function. Instead, $post->ID is used to return the post ID. $post is a global object that holds various information about the posts displayed on the page.