Category: website development
Use jQuery to check if HTML element is empty
Easy-peasy… use the link below to go to the article I found:
Pointing your home site’s url to a subdirectory using htaccess for wordpress
Exactly what it sounds like. Just saved me a butt load of time and a mess of annoying phone calls to the hosting server. Easy code editing then moving of the index.php & .htaccess files. Maybe this’ll do the same for any other developers out there in a bind.
Display Popular Posts by Views / Clicks in WordPress
Cool code I found that allows you to filter and display a WP site’s posts by views or “clicks”. If also works for custom post types as well perfectly. Simply add the filter “post_type => YOUR_CUSTOM_POSTTYPE” when you call the loop on the front end in the WP_QUERY function.
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…
Web Design Trends for 2014
Here’s an insight into what to expect for the rest of 2014 in regards to web design and development. An older article and obviously we’re already a 4th into the year but still a good read.
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
Target CSS for Chrome, IE, Firefox, and/OR Safari with custom CSS media queries by BrowserHacks
As simple as it gets… Use the css media querie code they provide to target any (yes ANY particular) browser.
Truly convenient for any last minute changes if something looks perfect in Firefox but not in Chrome.
Get the code at:
BrowserHacks.com
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.
WordPress: Hide Edit Profile Link
In case you need to give a customer access to a website without being able to edit their profile. *Gives you an option for inputting custom text where the profile page would normally be.
Simply place the code at the bottom of your functions.php page!
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 🙂
Add time to the date function in php
Quick and painless PHP code to hack the date function and add a numerical time to it. (ie + 5 hours, – 4 days, etc)
Toggle on/off embedded music using jquery
Here’s a link to toggle on/off embedded music using jquery.
Handy tool from the guys at daniweb.com
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:
Google Web Designer Beta Launched by Google
Checked it out, toyed with it…. Pretty cool but will it replace the staples? Time will tell.
Click Here to Read An Article About it
Should we be scared? Not likely….
Call a WordPress Widget with a Shortcode
Had this issue today where I created a WordPress shortcode and put it in a text widget but when I saw it live it didn’t convert the shortcode.
Below is an article that gives you the code you need to put in your functions.php file to allow you to display them properly in the widgets.
Display Featured Images In WordPress Admin Post List
Here’s a snippet of code to add to your functions.php page in order to view your featured image in your posts admin section:
Worked like a charm!