Skip to content

Instantly share code, notes, and snippets.

@mintplugins
mintplugins / gist:f6d7be7fb6d7ee6d98b2
Last active November 10, 2015 03:15
Migrate Sermons
<?php
//Paste this function into your theme's functions.php file to create a duplicate ctc_sermon for each mp_sermon
//Set the args for the new query
$mp_sermon = array(
'post_type' => "mp_sermon",
'posts_per_page' => -1,
'order' => 'ASC',
);
@mintplugins
mintplugins / gist:aeac07660a5d0ab5117e
Created June 3, 2015 16:38
MP Stacks + DownloadGrid: How to add the Author to the Title for Grid Items
function my_downloadgrid_add_author_to_title( $post_title, $post_id ){
//Get the author of the post in question
$post_object = get_post( $post_id );
$author_id = $post_object->post_author;
$author_nicename = get_the_author_meta( 'user_nicename', $author_id );
return $post_title . ' | ' . $author_nicename;
}
@mintplugins
mintplugins / gist:5caf807b094bddfb6181
Created May 31, 2015 03:50
PostGrid: Filter the classes for a postgrid links to make them open in a lightbox
/**
* Filter the classes for a postgrid links to make them open in a lightbox
*
* @since 1.5.0
*
* @param string $classes The string containing all of the classes for postgrid links
*/
function my_custom_postgrid_classes( $classes ){
return 'mp-stacks-lightbox-link';
}
@mintplugins
mintplugins / gist:34976827e7e435f0c49d
Last active August 29, 2015 14:22
PostGrid: How to use featured image instead of permalink on postgrid page
/**
* Filter the permalink for a postgrid posts if it is a custom post type
*
* @since 1.5.0
*
* @param string $permalink The permalink for the post in question
* @param int $grid_post_id The post ID in question.
* @param int $brick_id The Brick ID containing the post grid
*/
function my_custom_permalinks_for_postgrid( $permalink, $grid_post_id, $brick_id ){