Skip to content

Instantly share code, notes, and snippets.

/* Adjust portfolio shortcode item font-sizes */
.jetpack-portfolio-shortcode h2.portfolio-entry-title {
font-size: 20px;
}
.jetpack-portfolio-shortcode .portfolio-entry-content p {
font-size: 16px;
}
@jordesign
jordesign / cm_formatting.php
Created October 7, 2014 06:26
Campaign Monitor Formatting Options
if ( ! function_exists( 'cmcm_styles_dropdown' ) ) {
function cmcm_styles_dropdown( $settings ) {
// Create array of new styles
$new_styles = array(
array(
'title' => __( 'Campaign Monitor Styles', 'wpex' ),
'items' => array(
array(
'title' => __('Paragraph 1','wpex'),
@jordesign
jordesign / cm_header.php
Created October 7, 2014 06:21
Campaign Monitor Conditional header
<!-- Include introductory content if this is a Landing Page -->
<?php if (is_page_template( 'page-landing.php' ) ){ ?>
<p>Do things here</p>
<?php } ?>
<!-- Include Title if this is a Section Page -->
<?php if (is_page_template( 'page-section.php' ) ){ ?>
<p>Do other things here</p>
<?php } ?>
@jordesign
jordesign / estimated_reading.php
Created July 3, 2014 12:00
Estimated Reading time
/**
* Estimate time required to read the article
*
* @return string
*/
function bm_estimated_reading_time() {
$post = get_post();
$words = str_word_count( strip_tags( $post->post_content ) );
@jordesign
jordesign / ctc-sermon-sidebar.php
Last active August 29, 2015 14:02
Church Theme Content - Sermon Taxonomy Sidebar
<div class="sidebarCat sermonTopics">
<h5>Topics</h5>
<?php $terms = get_terms("ctc_sermon_topic");
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
echo "<ul>";
foreach ( $terms as $term ) {
echo "<li><a href='" . get_term_link( $term ) . "'>" . $term->name . "</a></li>";
}
echo "</ul>";
@jordesign
jordesign / get_terms_paging.php
Last active August 29, 2015 14:02
Paging with get_terms
<?php
$page = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1;
// number of tags to show per-page
$per_page = 10;
$offset = ( $page-1 ) * $per_page;
$args = array( 'number' => $per_page, 'offset' => $offset, 'hide_empty' => 0 );
// Loop through terms here
$total_terms = wp_count_terms( 'ctc_sermon_series' );
@jordesign
jordesign / basic_testimonials_custom_post_type.php
Created July 23, 2012 08:13 — forked from BronsonQuick/basic_testimonials_custom_post_type.php
A basic Testimonials Custom Post Type for WordPress
<?php add_action( 'init', 'sennza_register_cpt_testimonial' );
function sennza_register_cpt_testimonial() {
$args = array(
'public' => true,
'query_var' => 'testimonial',
'rewrite' => array(
'slug' => 'testimonials',
'with_front' => false
),