Skip to content

Instantly share code, notes, and snippets.

View media317's full-sized avatar

Alan Smith media317

View GitHub Profile
@media317
media317 / CCN comments
Created October 25, 2014 23:38
custom commment issues
function custom_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
$GLOBALS['comment_depth'] = $depth;
?>
<li id="comment-<?php comment_ID() ?>" <?php comment_class() ?>>
<div class="comment-author vcard"><?php commenter_link() ?></div>
<div class="comment-meta"><?php printf(__('Posted %1$s at %2$s <span class="meta-sep">|</span>', 'hbd-theme'),
get_comment_date(),
get_comment_time(),
'#comment-' . get_comment_ID() );
@media317
media317 / Woo to DonorPro
Created July 22, 2014 01:00
Hopegivers WooCommerce to DonorPro
//* Send information to DonorPro
add_action( 'woocommerce_order_status_completed', 'hope_donor', 1, 5 );
/*
* Do something after WooCommerce sets an order on completed
*/
function hope_donor($user_id, $new_order, $paykey, $fields, $source) {
$order = new ID_Member_Order($new_order);
$the_order = $order->get_order();
if (!empty($the_order)) {
$price = $the_order->price;
@media317
media317 / Custom Post Type Loop
Created March 11, 2014 20:34
Conditional tag with Custom Post Type and Custom Taxonomy
//* Custom Genesis Loop
remove_action ( 'genesis_loop', 'genesis_do_loop' );
add_action ( 'genesis_loop', 'cbc_custom_loop' );
function cbc_custom_loop() {
if (has_term('custodial')) {
echo '<h1>';
echo the_title();
echo '</h1>';
@media317
media317 / multi-meta-boxes
Created December 16, 2013 21:33
Multiple Meta Boxes
<?php
/**
* Metaboxes
*
* This file registers any custom metaboxes
*
* @package Core_Functionality
* @since 1.0.0
* @link https://github.com/billerickson/Core-Functionality
* @author Bill Erickson <bill@billerickson.net>
@media317
media317 / UNIX format in WP loop
Created October 27, 2013 22:51
Getting UNIX date formated properly in loop
/** Loop for Projects **/
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
echo '<div id="container">';
while( $loop->have_posts() ): $loop->the_post();
echo '<div class="projects one-third '.genesis_get_custom_field('program') . ' ' .genesis_get_custom_field('project_type') . ' ' .genesis_get_custom_field('country') . '">';
echo '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail( $post_id, 'project' ). '</a>';
echo '<h3 class="mmi-country ' . genesis_get_custom_field('country') . '">' . genesis_get_custom_field('country') . '</h3>';
@media317
media317 / StartDate timestamp from UNIX
Created October 27, 2013 22:28
Change UNIX timestamp to M/D/Y
add_action( 'genesis_before_entry_content', 'mmi_sing_project_top');
function mmi_sing_project_top() {
global $post;
$begindate = genesis_get_custom_field('startdate');
$enddate = genesis_get_custom_field('finishdate');
echo '<div class="sing-project">';
. . . .
@media317
media317 / Sortby-Date
Created October 17, 2013 02:01
Sort order by date.
/* My metabox array */
array(
'name' => 'Start Date',
'desc' => 'Project Start Date',
'id' => 'startdate',
'type' => 'text_date',
),
/* My query function */
function mmi_projects_loop () {
@media317
media317 / CPT Genesis
Created September 27, 2013 13:40
How to pull the first term ...
array(
'name' => 'Project Type',
'desc' => 'Select all that apply to this project',
'id' => 'project_type',
'type' => 'multicheck',
'options' => array(
'admin' => 'Administration',
),
),
@media317
media317 / mmi.style.css
Created September 20, 2013 20:28
Stylesheet for Medical Ministry International
/*
Theme Name: Medical Ministry Child Theme
Theme URI: http://medicalministrytrips.org
Description: Medical Ministry Child theme is a two or three column child theme created for the Genesis Framework.
Author: Media317
Author URI: http://media317.net
Version: 2.0
Tags: blue, gray, white, one-column, two-columns, three-columns, left-sidebar, right-sidebar, fixed-width, custom-background, custom-header, custom-menu, full-width-template, sticky-post, theme-options, threaded-comments
@media317
media317 / responsive video div
Created September 18, 2013 23:39
Create a Responsive video player div
#mediaspace_wrapper {
position: relative;
height: 0;
padding-bottom: 59%;
padding-top: 0;
}