Skip to content

Instantly share code, notes, and snippets.

@wpperform
wpperform / gist:766a1c5db51a49c6a36a
Created May 22, 2014 22:05
wpPERFORM.com Tweet Button Shortcode Parameters
[wpp-tweet via="wpperform" related="wpperform" text="You need to see this!" hashtag="somehashag,anotherone,yetanother" count="none" size="large"]
where ...
via = your Twitter username without the @
related = up to 2 related accounts
text = the tweet text, which will default to the post title, as adjusted for length
hashtag = a comma separated list of hashtags, without the # character
count = 1 of the following: none, horizontal, vertical (default = horizontal)
size = 1 of the following: medium, large
@wpperform
wpperform / wpperform-url-examples
Last active August 29, 2015 14:02
URL Examples
# absolute URL loads using insecure HTTP protocol
http://wpperform.com/
# absolute URL loads using secure HTTPS
https://wpperform.com/
# protocol relative or protocol agnostic URL's
//wpperform.com/
//wpperform.com/relative-urls/
//www.mysite.com/
@wpperform
wpperform / wpp-genesis-grid-image-right.php
Created November 26, 2012 05:13
Aligns attached image in thumbnail size to the right in Genesis grid loop
<?php
/*
Plugin Name: wpPERFORM.com Genesis Grid Image - Align Right
Description: Aligns attached image in thumbnail size to the right in Genesis grid loop
Version: 0.1
License: GPL
Author: The wpPERFORM.com Team
Author URI: http://wpperform.com
*/
add_filter( 'genesis_grid_loop_args','wpp_grid_image_left' );
Parameters:
All parameters are optional.
alt = The text to tweet, which replaces the text between the opening and closing shortcodes
hashtag = A comma separated list of the hashtags to be appended to the tweet WITHOUT THE #
link = The link to be included in the tweet, which otherwise defaults to the post's permalink
via = Twitter user name to associate with the tweet WITHOUT THE @
Example 1: Basic usage
@wpperform
wpperform / page_postincats.php
Created December 30, 2012 04:33
Genesis page template that adds posts in categories to a page
<?php
// Template Name: Page With Posts In Categories
//
// For Genesis framework. To use:
// 1) Create a page
// 2) Set the page template in the Page Attributes panel to this template
// 3) Turn off comments and trackbacks
// 4) Set a custom field on the page of query_args_category__and equal to the numeric ID of the category
// 5) Add additional custom fields with the same name but different category ID to display multiple categories
@wpperform
wpperform / page_postincatscondensed.php
Last active December 10, 2015 08:58
Genesis page template that adds posts in categories to a page but displays limited post data
<?php
// Template Name: Page With Posts In Categories Condensed
//
// For Genesis framework. To use:
// 1) Create a page
// 2) Set the page template in the Page Attributes panel to this template
// 3) Turn off comments and trackbacks
// 4) Set a custom field on the page of query_args_category__and equal to the numeric ID of the category
// 5) Add additional custom fields with the same name but different category ID to display multiple categories
@wpperform
wpperform / yarpp-template-interested.php
Created December 31, 2012 04:36
Template for Yet Another Related Posts Plugin (YARPP) that returns related posts with the relatedness score
<?php /*
YARPP Template: Also Interested...
Description: This template returns the related posts with the relatedness score.
Author: mitcho (Michael Yoshitaka Erlewine) tweaked by the wpPERFORM.com team
*/
?>
<h3 class="related-posts">You May Also Be Interested In ...</h3>
<?php if (have_posts()):?>
<ol>
<?php while (have_posts()) : the_post(); ?>
@wpperform
wpperform / genesis-category-template.php
Created December 31, 2012 15:43
Genesis category template to display limited post info for
<?php
remove_action('genesis_post_content', 'genesis_do_content');
remove_action('genesis_post_content', 'genesis_do_post_content');
remove_action('genesis_before_post_content', 'genesis_post_info');
remove_action('genesis_post_content', 'genesis_do_post_image');
remove_action('genesis_after_post_content', 'genesis_post_meta');
//add_filter( 'pre_option_posts_per_page', 'custom_posts_per_page_filter' );
function custom_posts_per_page_filter( $num ) {
@wpperform
wpperform / genesis-category-template-2-full-posts.php
Created December 31, 2012 15:55
Displays full content for first 2 posts, excerpts for the rest
<?php
remove_action('genesis_post_content', 'genesis_do_post_content');
add_action('genesis_post_content', 'custom_post_content');
function custom_post_content() {
global $loop_counter;
if( absint($loop_counter) < 3 ) {
the_content(); ?>
<?php
/*
Plugin Name: wpPERFORM.com Genesis Connect for WooCommerce Helper
Description: Adds theme support for Genesis Connect for WooCommerce to Genesis themes
Version: 0.1
License: GPL
Author: The wpPERFORM.com Team
Author URI: http://wpperform.com
*/