User Profile Meta

You can add or get rid of User profile fields in the backend by using the code on this page. http://davidwalsh.name/add-profile-fields I also created a profile page to keep track of progress for each user that is logged in using Gravity Forms. These are the steps I used: Create a Form that has checkboxes. Install Read More…

Category Dropdown

WordPress has a built-in display categories widget that can show as a list or a dropdown. However, it only shows categories with posts attached to them. If you want to show all categories in a dropdown use this code. <form action=”<?php bloginfo(‘url’); ?>/” method=”get”> <?php $select = wp_dropdown_categories(‘show_option_none=Select State&show_count=1&orderby=name&echo=0&selected=0&hide_empty=0’); $select = preg_replace(“#<select([^>]*)>#”, “<select$1 onchange=’return this.form.submit()’>”, Read More…

Remove phone formatting

I used this function to strip the formatting from a submitted phone number and return just the numbers e.g. 1234567890 $phone = preg_replace(‘/\D+/’, ”, $entry[8]); print_r($phone); The phone number was formatted like this (123)456-7890

Google Analytics Async Event Tracking

Trying to figure out how to get event tracking working with the new async (analytics.js) code was a pain. Googles documentation for anything to do with analytics is always confusing. <script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘create’, ‘UA-XXX-X’, ‘example.com’); ga(‘send’, ‘pageview’); //here is the code that actually worked. You put it in the script area Read More…

Buddypress Tips and Tricks

These are some things that I learned when trying to modify buddypress pages that took me a while to figure out. User Blogs Use these 2 plugins together to add user blog capability without having to use a multisite setup. Buddyblog BP Simple Front End Post To change the permalink slug to what you want Read More…

File Recovery Software FREE

http://www.cgsecurity.org/wiki/TestDisk_Download   I used this file recovery software to get .cr2 files from a formatted SD card. It also does every other type of file and it is FREE. The only downside is that it is DOS so windows only and no GUI. On the plus side you dont have to install it. It just Read More…