If you want to get the level of the current page in WordPress you can use this // gets the depth of the current page global $wp_query; $object = $wp_query->get_queried_object(); $parent_id = $object->post_parent; $depth = 0; while ($parent_id > 0) { $page = get_page($parent_id); $parent_id = $page->post_parent; $depth++; } echo $depth; This function will echo … Continue reading Get the depth of the current page in WordPress
Author: Steven Dobbelaere
jQuery HTML5 Twitter plugin for iPad using Localstorage
I wrote a small jQuery plugin that gets it's parameters from html 5 data attributes, so configuration is simple. It needs some cleanup but I'll do that later 😉 You can download a zip of the files You can add 3 html5 data attributes to configure the plugin: data-twitter-username (required / used to set the … Continue reading jQuery HTML5 Twitter plugin for iPad using Localstorage
Email harvesting of a domain using Linux Backtrack
A while ago I wanted to scan which email addresses can be found by spambots because that domain received a lot of spam. You can prevent users from capturing your email addresses from your website by encrypting the characters with html or javascript. This tools can encrypt your email address with javascript http://hivelogic.com/enkoder/ and this website http://www.wbwip.com/wbw/emailencoder.html does this … Continue reading Email harvesting of a domain using Linux Backtrack
Jagged edges with CSS transform in Google Chrome (webkit)
When applying css transform on an element with a background image, the edges will appear jagged in Google Chrome. Also the image will appear pixelated. To fix this you can add this to your css selector: (this will only work for webkit browsers) -webkit-backface-visibility: hidden; I've added a small demo here The first image in … Continue reading Jagged edges with CSS transform in Google Chrome (webkit)
Running database queries in WordPress
WordPress has a built-in object class for dealing with database queries. It's called wpdb and it's found in the includes/wp-db.php file. When you're running queries you should always use this class to execute them. To use this class you first need to define $wpdb as a global variable before you can use it. Just place … Continue reading Running database queries in WordPress
How to enable the WordPress maintenance mode
WordPress has a built-in maintenance feature. By adding a ".maintenance" file to your website's root directory with the piece of code WordPress will trigger its maintenance mode. <?php $upgrading = time(); ?> This file is also used during the auto-update process. By using the maintenance mode, users will not see any error messages while you're … Continue reading How to enable the WordPress maintenance mode
Limit the number of post revisions in WordPress
For each saved edit made to a post or a page, WordPress saves a revision in the database. This can really increase the size of your database when your working with a lot of posts or pages. WordPress has a built-in revisions option which you can set in the wp-config.php file. You can also disable … Continue reading Limit the number of post revisions in WordPress
Show the signal strength of your iphone instead of the default signal strength bars
By just going through these steps you'll be able to see your signal reception of your iPhone in decibels (dBm). Normally the value should be between -60 and -90 dBm. Where I live the strength is only -95. First you need to dial *3001#12345#* and press call. Now you'll enter "Field test mode". When you press … Continue reading Show the signal strength of your iphone instead of the default signal strength bars
visible area within the iPhone and iPad browser
visible area in the browser on iPhone portrait320*356 visible area in the browser on iPhone landscape480*208 visible area in the browser on iPad portrait 931*768 visible area in the browser on iPad landscape1024*675
Remove SEO title, keywords, description columns from the post and pages list when using the all-in-one-seo-pack WordPress plugin
I always use the all-in-one-seo-pack for WordPress websites which is a great plugin for SEO purposes. The only drawback is that it screws up the list of pages or posts in your WordPress admin section by adding three extra colums to it (SEO title, SEO keywords, SEO description). To remove these colums go to the … Continue reading Remove SEO title, keywords, description columns from the post and pages list when using the all-in-one-seo-pack WordPress plugin