This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adds an Options page to your Dashboard */ | |
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_page(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE `table_name` | |
SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.last-word { | |
color: #00f; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 class="js-title">My Cool Title</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get RSS Feed(s) | |
include_once( ABSPATH . WPINC . '/feed.php' ); | |
// Get a SimplePie feed object from the specified feed source. | |
$rss = fetch_feed( 'http://journeysfromayrden.tumblr.com/rss' ); | |
if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Infinite next and previous post looping in WordPress | |
* | |
* This will stay in same Custom Taxonomy Term. Also NEXT and PREVIOUS | |
* are switched to give the impression of "Going Forard and Back" | |
*/ | |
if( get_adjacent_post(true, '', false, 'CUSTOM_TAX') ) { | |
next_post_link( '%link', 'PREVIOUS', TRUE, ' ', 'CUSTOM_TAX' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Fill in your custom taxonomy here | |
$yourTaxonomy = 'CUSTOM_TAXONOMY'; | |
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY | |
$category = get_the_terms( $postId, $yourTaxonomy ); | |
$useCatLink = true; | |
// If post has a category assigned. | |
if ($category){ | |
$category_display = ''; |
OlderNewer