Skip to content

Instantly share code, notes, and snippets.

View saragreenlaw's full-sized avatar

Sara Greenlaw saragreenlaw

View GitHub Profile
<script>
if ($('[data-title="bump-image"]').length > 0) {
$('.otoText2').append($('[data-title="bump-image"]'));
}
</script>
// Add author box to single posts and author archives
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
add_filter( 'get_the_author_genesis_author_box_archive', '__return_true' );
// And remove it from anything that's not a post
add_action ('genesis_entry_footer', 'wpm_remove_author_box' );
function wpm_remove_author_box() {
if ( get_post_type() != 'post' ) {
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
}
}
.row {
width: 100%;
text-align: center;
}
.columns {
width: 33%;
min-width: 280px;
vertical-align: top;/*Fix for different height elements*/
margin-bottom: 10px;
@saragreenlaw
saragreenlaw / rails-postgres-backbone-bootstrap-bootswatch
Created October 15, 2016 21:24 — forked from sionc/rails-postgres-backbone-bootstrap-bootswatch
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@saragreenlaw
saragreenlaw / overlay.js
Created February 19, 2016 02:52
Create additional classes to create an overlay for WooCommerce Items
jQuery(document).ready(function(){
jQuery(".home li.product").wrap('<div class="overlay"></div>');
jQuery('.woocommerce ul.products li.product a img').wrap('<div class="tint"></div>');
jQuery("li.product").wrap('<div class="overlay"></div>');
jQuery('li.product a img').wrap('<div class="tint"></div>');
});
@saragreenlaw
saragreenlaw / .htaccess
Created December 18, 2015 01:00 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@saragreenlaw
saragreenlaw / gist:7cb50bb01d00384e10d0
Created May 23, 2015 15:14
You need to remove or add the shortcodes you want to display.
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}}
//Read More Button For Excerpt
function themeprefix_excerpt_read_more_link( $output ) {
global $post;
return $output . ' <a href="' . get_permalink( $post->ID ) . '" class="more-link" title="Read More">Read More</a>';
}
add_filter( 'the_excerpt', 'themeprefix_excerpt_read_more_link' );
//* Don't show layout settings box on certain template pages admin
add_action( 'init', 'remove_layouts_templates_init' );
function remove_layouts_templates_init() {
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
$template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
// check for the following template types
if ($template_file == 'page-home.php'
or $template_file == 'page-testimonial.php'
or $template_file == 'page-landing.php'
add_action( 'tgmpa_register', 'register_required_plugins' );
// This function is called from the above hook
function register_required_plugins()
{
// The plugins array allows us to define multiple plugins we want to include.
// The commented out example shows how we can include and activation a bundled
// plugin zip file in our theme.
$plugins = array(
/* array(