Skip to content

Instantly share code, notes, and snippets.

@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' );
@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-changes.php
Last active January 29, 2017 17:14
Changes to Yet Another Related Posts Plugin to support templates in plugin templates folder instead of theme folder
// 5 changes to /classes/YARPP_Core.php for version 4.3.6
// each change involves commenting out 1 line and replacing with revised version
// near line 489
// $this->templates = glob(STYLESHEETPATH . '/yarpp-template-*.php');
$this->templates = glob(YARPP_DIR . '/yarpp-templates' . '/yarpp-template-*.php');
// near line 1121
// } else if ((bool) $template && file_exists(STYLESHEETPATH.'/'.$template)) {
} else if ((bool) $template && file_exists(YARPP_DIR . '/yarpp-templates/' . $template)) {
@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(); ?>
@wpperform
wpperform / genesis-add-nav-div.php
Created January 4, 2013 12:26
Add a wrapping div around nav in a Genesis child theme
remove_action('genesis_before_header', 'genesis_do_nav');
add_action('genesis_before_header', 'custom_genesis_do_nav');
function custom_genesis_do_nav() {
printf( '<div id="nav-wrap">' );
$nav = wp_nav_menu(array(
'theme_location' => 'primary',
'menu' => 29,
'container' => '',
'menu_class' => genesis_get_option('nav_superfish') ? 'nav superfish' : 'nav',
'echo' => 0
<?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
*/
<?php
/*
Category template for Genesis framework to display 5 full posts, no post info or post meta
Author: wpPERFORM.com
To use, put a copy in child theme folder and rename to category-xx.php where xx is replaced by the numeric ID of the category
to which the template applies.
*/