Skip to content

Instantly share code, notes, and snippets.

View joedooley's full-sized avatar

Joe Dooley joedooley

  • Florida
  • 07:52 (UTC -04:00)
View GitHub Profile
@joedooley
joedooley / init.php
Created October 11, 2015 02:03
Load Framework Files and Features
<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Framework
* @author StudioPress
* @license GPL-2.0+
@joedooley
joedooley / add_theme_support_common_customizer_features.php
Created October 11, 2015 09:01
add_theme_support for custom header, custom background and an array of style options
<?php
//* Add support for custom header
add_theme_support( 'custom-header', array( 'width' => 250, 'height' => 70, 'header-selector' => '.site-title a', 'header-text' => false ) );
//* Add theme support for custom background
add_theme_support( 'custom-background' );
//* Add theme support for additional color style options
add_theme_support( 'genesis-style-selector', array(
@joedooley
joedooley / slick-slider.php
Created October 18, 2015 18:59
slick-slider
<?php
// WP_Query arguments for slide CPT
$args = array (
'post_type' => 'slide',
'posts_per_page' => '5'
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
@joedooley
joedooley / site-container-fade-in.css
Created October 24, 2015 03:51
Site Container Fade In
/* Site Container Fadein
---------------------------------------------------------------------------------------------------- */
.site-container {
-webkit-animation: fadein 1s;
-moz-animation: fadein 1s;
-ms-animation: fadein 1s;
-o-animation: fadein 1s;
animation: fadein 1s;
}
@joedooley
joedooley / woocommerce-add-brand-taxonomy-single-product.php
Last active October 25, 2015 06:49
* Add Brand taxonomy link to Single Product page * Add Brand taxonomy link to Single Product page * Add Brand taxonomy link to Single Product page Add Brand taxonomy link to Single Product page before meta
<?php
add_action('woocommerce_product_meta_start', 'my_woocommerce_after_single_product' );
/**
* Add Brand taxonomy link to Single Product page
* @author Joe Dooley
*
*/
function my_woocommerce_after_single_product () {
@joedooley
joedooley / modify-read-more.php
Created November 1, 2015 00:58
/** Conditionally Customize Read More Text */ Conditionally Customize Read More Link
<?php
/** Conditionally Customize Read More Text */
add_filter( 'excerpt_more', 'choosy_blog_read_more_link' );
add_filter( 'get_the_content_more_link', 'choosy_blog_read_more_link' );
add_filter( 'the_content_more_link', 'choosy_blog_read_more_link' );
function choosy_blog_read_more_link() {
if ( is_home() )
@joedooley
joedooley / acf-theme-options.php
Last active November 1, 2015 01:09
Create a Theme Options Page
<?php
// ACF Theme Options Page
if( function_exists('acf_add_options_page') ) {
$acf_theme_settings = acf_add_options_page(array(
'page_title' => 'Theme General Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
@joedooley
joedooley / wc-image-wrap.php
Created November 1, 2015 01:24
Wrap WooCommerce archive image in div
// WooCommerce add the image wrap
add_action( 'woocommerce_before_shop_loop_item_title', create_function('', 'echo "<div class=\"img-wrap\">";'), 5, 2);
add_action( 'woocommerce_before_shop_loop_item_title', create_function('', 'echo "</div>";'), 12, 2);
@joedooley
joedooley / functions.php
Created November 1, 2015 01:37
Add Theme Support Function
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
//* Enable Support for WooCommerce
add_theme_support( 'woocommerce' );
//* Add html5 markup structure
add_theme_support( 'html5' );
//* Add viewport meta tag for mobile browsers
@joedooley
joedooley / enqueue-slick-carosuel.php
Created November 1, 2015 01:59
Enqueue Slick Carosuel
<?php
//* Enqueue scripts and styles for Slick Slider
add_action( 'wp_enqueue_scripts', 'choosy_slick_slider_enqueue_scripts' );
function choosy_slick_slider_enqueue_scripts() {
if( is_front_page() )
{
wp_enqueue_style( 'slick-css', get_stylesheet_directory_uri() . '/lib/css/slick.css', array(), CHILD_THEME_VERSION );