Skip to content

Instantly share code, notes, and snippets.

View surefirewebserv's full-sized avatar

Jonathan Perez surefirewebserv

View GitHub Profile
@surefirewebserv
surefirewebserv / gist:3795553
Created September 27, 2012 18:26
Array for Structural Wraps
if ($gs_theme_support_functions['three']) {
$gs_structural_wrap = of_get_option('gs_structural_wraps', 'none' );
add_theme_support( 'genesis-structural-wraps', array_keys($gs_structural_wrap, 1) );
}
@surefirewebserv
surefirewebserv / simple-genesis-homepage.php
Last active April 16, 2019 14:22
Simple Homepage Layout for Genesis Framework.
<?php
add_action( 'genesis_after_header', 'sf_featured_slideshow' );
/**
* Add slide show widget area after the header.
*
* @author Sure Fire Web Services
* @link http://surefirewebservices.com/?p=1542
*
* @return Return null if not the homepage post.
*/
@surefirewebserv
surefirewebserv / postsubmit.js
Created November 8, 2012 21:15
Ajax Post Submit
$("#submit").click(function() {
$.post("add.php", $("#addform").serialize());
});
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
body,
h1,
h2,
h2 a,
h2 a:visited,
h3,
h4,
@surefirewebserv
surefirewebserv / StripURI.php
Last active December 11, 2015 11:39
This snippet strips the URI of the web address no matter what page your on. Then adds a meta description according to that page name. So in the case of 'connect' the web page would actually be www.sitename.com/whatever/connect.php and anything you put within that case, would only effect that page.
<?php
$thisPage = $_SERVER["REQUEST_URI"];
function get_page_name ( $page )
{
$array = explode( "/", $page );
for ( $i = 0; $i < count( $array ); $i++ )
{
$name = $array[ $i ];
}
@surefirewebserv
surefirewebserv / gist:5067222
Last active December 14, 2015 09:49
Remove ?ver=xxx from styles and scripts.
<?php
/** Remove ?ver=xxx from styles and scripts */
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
@surefirewebserv
surefirewebserv / gist:5247904
Created March 26, 2013 18:32
CSS Structure for Genesis Sandbox
/* Table of Contents
01 Import Fonts
02 Base Styles
Defaults
Wraps
Containers and Columns
Entry Content Structure
Headings and Titles
-- Layout --
@surefirewebserv
surefirewebserv / ad_code.php
Last active December 15, 2015 16:58
Display ad_id (or anything really) according to category ID. Thank you @garyj
<?php
global $post;
$lookup = array(
// category ID => ad ID
'1084' => '600',
'1085' => '601',
'1095' => '602',
'1086' => '603',
@surefirewebserv
surefirewebserv / readmore.php
Created April 19, 2013 14:45
Edit Read more Link
<?php
/** Edit read more link */
add_filter( 'excerpt_more', 'sf_read_more_link' );
add_filter( 'get_the_content_more_link', 'sf_read_more_link' );
add_filter( 'the_content_more_link', 'sf_read_more_link' );
function sf_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '" rel="nofollow">Read More</a>';
}
@surefirewebserv
surefirewebserv / gist:5504412
Created May 2, 2013 18:49
Much Simpler Grid Loop. Takes the post class and adds the column class to it. Also takes the first x posts and removes that class, which poses as a "featured" type of post. No crazy manipulation, just messing with classes and adding the right size images... Blog Post To come...
<?php
add_action('genesis_before_post_title', 'sfws_homepage_teaser_image');
/**
* Adds Images to Posts in Grid
*
* Takes the amount of posts and applies the right size image, whether it's a featured post or a grid block post.
*
* @category Grid Loop
* @author Jonathan Perez, SureFireWebServices <jperez@surefirewebservices.com>