Skip to content

Instantly share code, notes, and snippets.

View amberhinds's full-sized avatar

Amber Hinds amberhinds

View GitHub Profile
<?php
//* Archive Image Settings: this file registers the archive image settings to Theme Settings.
//* Register Defaults
function acd_archive_img_defaults( $defaults ) {
$defaults['locations_image_url'] = '';
$defaults['doctors_image_url'] = '';
$defaults['services_image_url'] = '';
return $defaults;
@amberhinds
amberhinds / index.html
Created February 26, 2016 17:46
Meta Tags on Website
<head>
<meta charset="UTF-8" />
<title>Dancey Pants Disco – Work and Life of an Artist/Illustrator living on Nantucket.</title>
<meta name="description" content="Work and Life of an Artist/Illustrator living on Nantucket." />
<link rel="canonical" href="https://danceypantsdisco.com/" />
// ...Additional Meta Here...
</head>
@amberhinds
amberhinds / fcwp-testimonials.php
Created February 29, 2016 06:27
How to create a plugin
<?php
/**
* Plugin Name: FCWP Testimonials
* Plugin URI: http://www.meetup.com/Fort-Collins-WordPress-Meetup
* Description: A basic testimonials plugin built for the Fort Collins WordPress meetup
* Version: 1.0.0
* Author: Amber Hinds, David Hayes, Jeremy Green, Michael Launer, Mike Selander
* Author URI: http://www.meetup.com/Fort-Collins-WordPress-Meetup
* Text Domain: fcwp-testimonials
* License: GPL2
@amberhinds
amberhinds / fcwp-testimonials.php
Created February 29, 2016 06:47
Require necessary files
<?php // Don't include the PHP again when copy-pasting from this gist.
// Call in necessary files
require plugin_dir_path( __FILE__ ) . 'lib/posttype.php';
@amberhinds
amberhinds / posttype.php
Created February 29, 2016 06:51
Register a post type in WordPress
<?php
//* This file adds the custom post type to our testimonials plugin with a taxonomy and custom meta box options.
/**
* Create testimonials custom post type.
*
* Registers the testimonial custom post type.
*
* @see register_post_type
*/
add_action( 'init', 'fcwp_testimonials_post_type' );
@amberhinds
amberhinds / posttype.php
Created February 29, 2016 07:10
Register a Taxonomy
<?php // Don't include this more than once in your file
/**
* Create taxonomy for testimonials CPT.
*
* Registers a hierarchical (like categories) taxonomy for the testimonials custom post type
*
* @see register_taxonomy
*/
add_action( 'init', 'fcwp_testimonials_tax' );
@amberhinds
amberhinds / single-event.php
Created April 19, 2016 15:08
Example of a CPT single post that uses ACF
<?php
/* Add custom body class */
add_filter( 'body_class', 'techup_featured_body_class' );
function techup_featured_body_class( $classes ) {
$classes[] = 'techup-featured-image recruiting-event';
return $classes;
}
/* Force full width content */
@amberhinds
amberhinds / functions.php
Created July 21, 2016 06:24
Rename Genesis Nav Menus
<?php
//* Do NOT include teh opening PHP tag
//* Rename primary and secondary navigation menus
add_theme_support( 'genesis-menus' , array( 'primary' => __( 'Top Navigation Bar', 'genesis-sample' ), 'secondary' => __( 'Footer Menu', 'genesis-sample' ) ) );
@amberhinds
amberhinds / functions.php
Created August 4, 2016 04:02
Remove Divi Shortcodes from WordPress Content
add_filter('the_content', 'remove_divi_shortcodes');
function remove_divi_shortcodes( $content ) {
$content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);
return $content;
}
@amberhinds
amberhinds / shortcodes.php
Last active September 13, 2016 08:20
speakers shortcode
<?php
if (!function_exists('wpt_speakers')) {
function wpt_speakers( $atts, $content = null ) {
extract(shortcode_atts(array(
'event'=> '',
'class' => '',
), $atts));
$t = get_term_by( 'slug', $levelsp, 'levelsp' );
$out="</div><div class='row-fluid speaker-level'>".do_shortcode('[title-bordered]'.strtoupper($t->name).'[/title-bordered]')."</div><div class='row-fluid'>";