Skip to content

Instantly share code, notes, and snippets.

<script>
$(document).ready(function() {
$('.js-title').each(function(index, element) {
var heading = $(element);
var word_array, last_word, first_part;
word_array = heading.html().split(/\s+/); // split on spaces
last_word = word_array.pop(); // pop the last word
first_part = word_array.join(' '); // rejoin the first words together
@accrane
accrane / force-upgrade.php
Created March 15, 2016 19:49
Force Upgrade WordPress
<?php
/*
WordPress Force Upgrade Script
Copyright (C) 2006 Mark Jaquith
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
@accrane
accrane / change-user-role-mysql.txt
Created March 15, 2016 19:44
Change WordPress User Role to Admin mySql
-- Look at the field called "id" in the result set
--
select * from wp_users
where user_login = 'WORDPRESS_USERNAME_GOES_HERE';
-- Substitute the above "id" value in the "user_id" field below.
-- This is an integer value so do not use quotes around it
-- For example if the above "id" is the value 10 then the resulting line would be: where user_id = 10
--
update wp_usermeta
@accrane
accrane / gist:813243866dd9f116d47d
Created February 15, 2016 21:48
Find and Replace phpMyAdmin
UPDATE `table_name`
SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text')
@accrane
accrane / functions.php
Created January 3, 2016 13:28
Add Options page to your ACF Dashboard
/* Adds an Options page to your Dashboard */
if( function_exists('acf_add_options_page') ) {
acf_add_options_page();
}