Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@accrane
accrane / google-captcha-v2.html
Created April 14, 2017 19:01
Google Captcha V2 page setup
<!DOCTYPE html>
<html>
<head>
<title>Google Captcha v2</title>
<script type="text/javascript" language="JavaScript">
// Callback to get the button working.
function enableBtn1(){
document.getElementById("button1").disabled = false;
@accrane
accrane / change-first-word.js
Created March 6, 2017 16:17
jQuery solution to changing the styling of the first word
/*
*
* Make first word in date underlined
*
------------------------------------*/
$('.js-first-word').each(function(index, element) {
var heading = $(element);
var word_array, last_word, first_part;
word_array = heading.html().split(/\s+/); // split on spaces
@accrane
accrane / custom-flexslider-carousel.js
Created January 18, 2017 18:40
Responsive call to a flexslider carousel
@accrane
accrane / custom-flexslider-images-loaded.js
Created January 5, 2017 16:34
Load Flexslider with Images loaded function
$('.flexslider').imagesLoaded( function() {
$('.flexslider').flexslider({
animation: "fade",
slideshowSpeed: 5000,
smoothHeight: true,
}); // end register flexslider
});
@accrane
accrane / function-move-yoast-to-bottom.php
Last active July 7, 2016 19:31
Move Yoast SEO box to the bottom of the page
/*-------------------------------------
Move Yoast to the Bottom
---------------------------------------*/
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@accrane
accrane / yoast-choose-primary-taxonomy-term.php
Last active September 29, 2022 08:20
Using Yoast, "Make Primary Category" for Custom Taxonomies
<?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 = '';
@accrane
accrane / infinite-previous-next-same-term-looping.php
Last active May 12, 2016 17:18 — forked from banago/infinite-previous-next-looping.php
Infinite next and previous post looping but in same term in WordPress
<?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' );
<?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
<h1 class="js-title">My Cool Title</h1>
.last-word {
color: #00f;
}