Easy-peasy… use the link below to go to the article I found:
Category: code
WordPress messing up shortcodes adding p tags: FIX
After great frustration with this I finally found an IMMENSELY simple answer. If you have custom shortcodes using HTML tags the WordPress ediotr may mess them up adding the normal “p” tags within it. Just add this code to your functions.php file and add the “raw” short code on either side… problem SOLVED.
WP_query exclude custom category posts of a custom taxonomy
So let’s say you created categories of a custom post type and then use a template to display those posts using the WP_query() function. THEN you want to filter those results further by excluding a particular custom category or categories you created. Look no further…
Straight from the WordPress Comments section: Click Here for the code
Unheap – A Tidy Repository of jquery plugins
Unheap offers a whole mess of custom coded jquery plugins ready to use. Check them out and use at will.
I gotta do this myself for all the other developers out there…
Backup Your MySQL Database Using PHP
This powerful php function by David Walsh has helped me automatically back up a mysql database. Use as needed, throw in a function to auto call or have the client choose to do it if needed.
Love it! Here’s the link: http://davidwalsh.name/backup-mysql-database-php
**NOTE this is an old blog post so the php function uses ereg_replace which you’ll need to manually update to the proper preg_replace
PHP Multiple Checkbox array
Simple way to handle coding and calling a form with multiple checkboxes as an array. Displays both the HTML form necessities & PHP coding for the mail() function.
Track Form Submissions Through Google Analytics With Contact Form 7 in WordPress
Another piece of code that allows you to track successful form submissions through the Contact 7 form plugin. Very simple!
Track File Downloads Through Google Analytics
PDFs, Email Clicks, and more can be tracked on a daily and real time basis by simply putting in a snippet of jquery in your header.
To view the tracked events for newest version of Google Analytics:
Real Time: Real Time > Events
Normal: Behavior > Events > Overview
NOTE: jQuery MUST BE INSTALLED for this to work.
W3TC Plugin – Automatically Clear Cache On Updating Post
Here’s a link to a code you put in your functions.php page that allows you to automatically clear your cache upon updating or saving a post. No more need to remember to empty it with this handy line 🙂
JQuery: How to get the class of the clicked element?
Needed this code this morning and figured I’d share it with you fine people.
Creating Custom WordPress Shortcodes Using PHP
Here’s a link for an explanation on creating your WordPress Shortcodes:
WordPress: Get Featured Image URL
Ever needed to get ONLY the featured image url? Below is an easy WordPress Support forum article I’ve referred to to get it. Easy as pie.