How to use the Fav Me plugin
Using the Plugin We leave the no-brainer part to learn something interesting now: how to implement the plugin in your theme. Basically all you need are 2 functions: mfp_the_link(); mfp_display(); mfp_the_link will display an “Add this post to your favorite post list” link wherever you call it. Best practice of course is to add the function Full Article…
20 Helpful WordPress SQL Queries Snippets
WordPress keeps every single scrap of information that is fed into it in a MySQL database, whether that be posts, pages, comments, blogroll, the plugin settings… everything. Yes, the WordPress admin backend is fantastic and it does allow you to control and edit all aspects of this information with ease. Up to a certain point Full Article…
13 SQL Queries for WordPress
For example, if you needed to change some information across the board in WordPress, going through each record is very time consuming and prone to human error. By simply executing a SQL query against your WordPress database, you can make the necessary changes quickly and efficiently. Shown below are some SQL queries that can be Full Article…
Dynamic user defined background images
This technique allows your WordPress content editors to specify their own custom background image for each page individually using custom fields (or meta boxes). Insert the following code into the head of your page: You will need to suppliment this with additional css which won’t need to change and can therefore be included in the Full Article…
How to 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 Full Article…
Using Javascript libraries with your plugin or theme
When you develop a WordPress plugin or theme, you might want to make use of some of the Javascript libraries distributed with the WordPress package such as Prototype, Scriptaculous and jQuery. Simple enough, they are in the “wp-includes/js/” folder, so what more is there to it? Can’t I just add a SCRIPT tag in the Full Article…
Restrict access by logged in author
Add this to your functions file: Then you can use this in your templates:
Textarea with a dynamic variable
Don’t specify the value of the <textarea> in a value attribute, but for a <textarea>you must put it between the two tags:
Add jQuery to WordPress
By default WordPress comes packaged with a jQuery function but because the jQuery libraries are updated constantly I decided to call my own jQuery libraries from a CDN. CDN stands for content delivery network, large enterprises have their own CDN’s where they host copies of popular script. In the following example I’m using the CDN Full Article…