Skip to content

Instantly share code, notes, and snippets.

@jaredatch
jaredatch / gist:3868835
Created October 10, 2012 22:16
Remove classes from body_class()
<?php
/**
* Remove classes from body_class()
*
* @param array $wp_classes
* @return array
*/
function ja_remove_body_classes( $wp_classes ) {
// The classes you wish to remove
@jaredatch
jaredatch / gist:3903968
Created October 17, 2012 06:19
Add new slides via AJAX to Flexslider carousel
jQuery(document).ready(function($){
$('.home-multimedia-flexslider').flexslider({
animation: "slide",
animationLoop: false,
slideshow: false,
maxItems: 3,
itemWidth: 195,
itemMargin: 0,
end: function(slider) {
@jaredatch
jaredatch / gist:3909892
Created October 18, 2012 04:42
create select from navigation
// Create the dropdown base
$("<select />").appendTo("nav");
// Create default option "Go to..."
$("<option />", {
"selected": "selected",
"value" : "",
"text" : "Go to..."
}).appendTo("nav select");
@jaredatch
jaredatch / gist:4027158
Last active October 12, 2015 12:28
dynamic mobile nav
/**
* Dynamically create a select element for the mobile navigation.
*
* @author Thomas Griffin
* @param obj $nav The main navigation object
* @param obj $ The main jQuery object
*/
function ResponsiveNav(nav, $){
/** Clone the nav, set the ID and use a concat var to store our data */
var nav_clone = $(nav).clone();
@jaredatch
jaredatch / wp-disable-feeds.php
Created November 15, 2012 17:28 — forked from ramseyp/wp-disable-feeds.php
Disable Feeds for WordPress site
<?php
/**
* Disable feeds
*
* @return string die
*/
function ja_disable_feed() {
wp_die( 'No feed available, please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!' );
}
@jaredatch
jaredatch / gist:4129442
Created November 22, 2012 04:39
Change text in post excerpt metabox
<?php
/**
* Change text for the post excerpt
*
* @since 1.0.0
* @param string $translated_text
* @param string $text
* @param string $domain
* @return string
*/
@jaredatch
jaredatch / gist:4526777
Created January 13, 2013 23:23
Reverse order of intragram images in Soliloquy. Show newest images first.
<?php
/**
* Reverse order of intragram images. Show newest images first.
*
* @since 1.0.0
* @param array $cached_data
* @param int $id
* @param array $data
* @return array
*/
@jaredatch
jaredatch / gist:4526950
Created January 14, 2013 00:08
Automatically select the correct image size when creating a new Soliloquy slideshow
<?php
/**
* Automatically select the correct image size when creating a new slideshow.
*
* @since 1.0.0
*/
function ja_soliloquy_default_image_size() {
if ( class_exists( 'Tgmsp', false ) ) {
if ( Tgmsp::is_soliloquy_add_edit_screen() ) {
@jaredatch
jaredatch / gist:5087091
Created March 5, 2013 00:48
Return the version of Genesis running
<?php
/**
* Template Name: Latest Genesis Version
*
* This file returns the version of Genesis that this site runs, which we
* assume is typically the latest.
*/
echo PARENT_THEME_VERSION;
@jaredatch
jaredatch / gist:5463651
Created April 25, 2013 22:11
Hides Premise menus and metaboxes related to the Landing Page functionality
<?php
/**
* Remove Premise menu items related to the Landing Page functionality
*
* @since 1.0.0
*/
function ja_remove_premise_menus(){
remove_menu_page( 'edit.php?post_type=landing_page' );
remove_submenu_page( 'premise-main', 'premise-styles' );
remove_submenu_page( 'premise-main', 'premise-style-settings' );