Skip to content

Instantly share code, notes, and snippets.

View stevengliebe's full-sized avatar
😄

Steven Gliebe stevengliebe

😄
View GitHub Profile
@stevengliebe
stevengliebe / excerpt-filter.php
Last active August 29, 2015 14:16
Filter the_excerpt to show content in a more ideal way. Notes here: http://stevengliebe.com/2015/02/26/excerpts-and-the-more-tag-in-wordpress-themes/
<?php
/**
* Filter the_excerpt to show content in a more ideal way.
*
* The way content is shown depends on the priority of a situation:
*
* 1. the_content with "Read More" link if the "More" tag is used
* 2. Manual excerpt with "Read More" link if excerpt is manually entered
* 3. the_content in its entirety if less than 200 words (nicer than automatic excerpt)
@stevengliebe
stevengliebe / ctc-change-sermon-slug.php
Last active September 1, 2017 02:43
Example of how to change Church Content plugin post type URL slug (e.g. "sermons" to "messages")
<?php
/**
* Change sermon slug in URL
*
* Example of how to change sermon slug in Church Content plugin.
* This is ideally placed in your own functionality plugin so that it works after switching themes.
*
* REQUIRED: Go to Settings > Permalinks and save after applying this, or it will not take effect
*
@stevengliebe
stevengliebe / responsive-embeds.js
Created August 26, 2015 12:26
responsive-embeds.js from Church Theme Framework with support for LiveStream
/**
* Responsive Embeds
*/
jQuery( document ).ready( function( $ ) {
// Remove <object> element from Blip.tv ( use iframe only ) - creates a gap w/FitVid
$( "embed[src*='blip.tv']" ).remove();
// Use FitVid for responsive videos and other embeds
<?php
function yourtheme_add_ctc_support() {
/**
* Plugin Support
*
* Tell plugin theme supports it. This leaves all features disabled so they can
* be enabled explicitly below. When support not added, all features are revealed
* so user can access content (in case switched to an unsupported theme).
@stevengliebe
stevengliebe / ctc-field-overrides.php
Last active September 1, 2017 02:42
Example of using Church Content plugin field_overrides. http://churchthemes.com/guides/developer/church-content/
<?php
'field_overrides' => array(
'_ctc_person_urls' => array(
'name' => __( 'New Title', 'yourtheme' ),
'desc' => __( 'Enter one URL per line.', 'yourtheme' )
),
'_ctc_person_email' => array(
'desc' => sprintf( __( 'The WordPress <a href="%s" target="_blank">antispambot</a> function is used to help deter automated email harvesting.', 'yourtheme' ), 'http://codex.wordpress.org/Function_Reference/antispambot' )
)
@stevengliebe
stevengliebe / load-church-theme-framework.php
Last active November 20, 2015 20:28
How to load Church Theme Framework in functions.php. http://churchthemes.com/guides/developer/framework/
<?php
/**
* Load framework
*/
require_once get_template_directory() . '/framework/framework.php'; // do this before anything
@stevengliebe
stevengliebe / ctfw-google-maps-api-key.php
Last active March 29, 2019 15:41
Example from Church Theme Framework of how to get the Church Content plugin's Google Maps API Key.
<?php
function ctfw_google_maps_api_key() {
$key = '';
// Make sure the Church Content plugin's function is available
if ( function_exists( 'ctc_setting' ) ) {
$key = ctc_setting( 'google_maps_api_key' );
}
@stevengliebe
stevengliebe / ct-agency-mode.php
Last active October 25, 2018 12:52
How to enable Church Content Pro "Agency Mode" in wp-config.php. https://churchthemes.com/go/agency-mode/
<?php
/**
* ChurchThemes.com Agency Mode
*
* See https://churchthemes.com/go/agency-mode/ for information.
* PHP 5.6+ is required. You can use define() with PHP 7+.
*/
const CT_AGENCY_MODE = array(
'name' => 'Acme Agency', // Agency or freelancer name to show user.