A web designer from Charlotte, NC, I enjoy working in the yard, kayaking, building stuff, making things, creating, thinking and of course WordPress.
View all posts by acrane →
To harden an old WordPress site, the first thing I did was change the table prefix to something other than wp_
But that somehow turned every user from admin to subscriber, now I was locked out. And when I tried to login, it redirected me to the homepage, not the wp-admin section. Here’s what I did:
First, grab this script, put it into a php file named, force-upgrade.php , by Mark Jaquith and upload it to the same directory as your wp-config file. Then visit that directory/force-upgrade.php It will prompt you to run the script. “Hopefully that does the trick.” – But you still need to change your permission via phpMyAdmin, skip past this script to do that.
To change your role to admin, edit the following sql script to what you need and run it in the SQL tab in phpMyAdmin
You can use Advanced Custom Fields to do some pretty cool things with Google Maps. But often you would want to spit out the address from the map in a formatted form. Here are some examples:
Add Advanced Custom Fields ACF to your admin columns in WordPress and be able to sort them.
For this I will add a custom thumbnail and Event start date for an “Event” Custom post type.
First, you need two functions. One to create the columns, overriding what was default in WordPress and one to tell what each column to do.
It’s important to note that the structure of the add_action: ‘manage_{YOUR_POSTTYPE}_posts_custom_column’
and the structure of the filter ‘manage_edit-{YOUR_POSTTYPE}_columns’
Then this final function to sort by Event Date:
Again, note the structure of the filter:
‘manage_edit-{YOUR_POSTTYPE}_event_sortable_columns’