Skip to content

Instantly share code, notes, and snippets.

@cdillon
cdillon / no_repeat.php
Created March 14, 2018 21:13
Don't repeat testimonials on the same page with multiple views.
<?php
/**
* Set global variable to track posts.
*/
function no_repeat_init() {
global $testimonials_showing;
$testimonials_showing = array();
}
add_action( 'wp', 'no_repeat_init' );
@cdillon
cdillon / sample-import-with-categories.csv
Created November 28, 2017 06:09
An import file with categories for Strong Testimonials.
post_type post_status post_title post_content client_name email tax_wpm-testimonial-category
wpm-testimonial publish The testimonial title The testimonial content The person's name The person's email Apple, Banana
@cdillon
cdillon / sample-import-basic.csv
Created November 28, 2017 06:07
A basic import file for Strong Testimonials.
post_type post_status post_title post_content client_name email
wpm-testimonial publish The testimonial title The testimonial content The person's name The person's email
@cdillon
cdillon / bad-review-redirect.php
Last active September 26, 2017 09:07
In Strong Testimonials, redirect bad reviews to a different page.
<?php
/**
* Strong Testimonials | Bad review redirect.
*
* IMPORTANT! If adding this to your theme's functions.php, remove line 1: <?php
*
* For help, contact chris@strongplugins.com
*
* @param $location
* @param $status
/* ========================
* Lucid Theme improvements
* ========================
*/
/* ---------------------
* if using Divi Builder
* ---------------------
*/
/**
* A shortcode to display the number of testimonials.
*
* For Strong Testimonials plugin.
*
* For all: [my_testimonial_count]
* For a specific category (by slug): [my_testimonial_count category="abc"]
*
* @param $atts
* @param null $content
@cdillon
cdillon / functions.php
Created December 23, 2016 11:15
Load a custom style sheet on your site using the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Load custom style sheet
add_action( 'wp_enqueue_scripts', 'custom_load_custom_style_sheet' );
function custom_load_custom_style_sheet() {
wp_enqueue_style( 'custom-stylesheet', CHILD_URL . '/custom.css', array(), PARENT_THEME_VERSION );
}
//* Replace default style sheet
@cdillon
cdillon / gist:31b4ccc4185dbd4b778b
Last active May 10, 2016 12:35
example of a custom form in WordPress using math Captcha plugin by BestWebSoft
// shortcode: [demo-form]
function demo_form_shortcode( $atts ) {
$name = '';
$email = '';
$company = '';
$errors = array();
if ( isset( $_POST['demo_form_submitted'] )
<?php
/**
* Strong Testimonials - Single testimonial content
*
* For Spacious theme by ThemeGrill
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'spacious_before_post_content' ); ?>
<?php
/**
* Strong Testimonials - Single post section
*
* For Spacious theme by ThemeGrill
*/
?>
<?php get_header(); ?>