Month: April 2009

WordPress : Enqueue Styles

This article will show you how to safely insert your CSS for your WordPress plugin or theme into the HEAD section of both the WordPress front-end and administration panel. I wrote an article a while back which explained how to safely enqueue JavaScript files into WordPress for your WordPress plugin or theme without simply injecting code into the HEAD section of either your the WordPress front-end or administration panel. Enqueuing scripts safely solves conflicts by preventing the same library/script from being loaded into WordPress twice. Enqueuing your CSS into WordPress using the wp_enqueue_style function doesn’t focus as much on conflict as it simply allows a quick, efficient way of ensuring that your styles are loaded in the correct order. When you enqueue WordPress a CSS file, you may specify dependencies which tells WordPress that your CSS depends on another CSS file and should be loaded afterwards. So where should you put this code? You can execute wp_enqueue_style when your plugin or theme file is loaded. For plugins, you can put it anywhere inside your main plugin file so that WordPress will execute wp_enqueue_style when your plugin is noticed/read initially. For a WordPress theme, you can execute wp_enqueue_style in your functions.php file. Using wp_enqueue_style <?php wp_enqueue_style($handle, $source, $dependencies, $version, $media); ?> Example wp_enqueue_style <?php wp_enqueue_style('mystyles', '/wp-content/plugins/myplugin/style.css', array('otherstyles', 'morestyles'), '1.0', 'screen'); ?> wp_enqueue_style Parameters $handle Name of the stylesheet. This should...

Read More

jQuery : Auto iFrame Height

This article will show you how to automatically adjust the height of an iFrame to the height of the content inside of the iFrame with the use of the jQuery JavaScript library and the jQuery autoHeight plugin. When you have an iFrame on a page and the height of the content in the iFrame is larger than the default or specified height of the iFrame, a vertical scrollbar will be shown which allows you to scroll the content inside the iFrame. You can remove the scrollbar by adding the attribute scrolling="no" to the iFrame element but the overflowing content...

Read More

Clear DNS Cache

Mac OS Tiger Mac OS Leopard I have experienced some problems in the past (and still do from time to time) with opening specific sites from my computer while my internet connection is fine and other sites open without any issues. The cause of the problem in my case is DNS cache which holds lookup values for hosts and the request times out because the cache is pointing to the incorrect location. I found that when I clear DNS cache on my Mac OS computer it solves the issue. Most DNS requests from your computer when you open a web page, check emails and do other internet related tasks is usually cached DNS stored internally on your computer. The DNS cache is saved every now and again in order to speed up lookups to the same host(s) in the future for better performance. If you need to clear your DNS cache on Mac OS for some reason or another, you can do it with the following command. Clear DNS Cache in Mac OS Tiger lookupd -flushcache Clear DNS Cache in Mac OS Leopard dscacheutil...

Read More

"; -->

Stay up to date

Get one email per month with latest news. You can unsubscribe at any time

Fill in a valid email


Pin It on Pinterest

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!