Skip to content

Instantly share code, notes, and snippets.

View gspice's full-sized avatar

Ginger Coolidge gspice

  • GSC Solutions LLC
  • Lincoln City, Oregon
View GitHub Profile
@gspice
gspice / testimonial-content-box-gray.css
Last active August 29, 2015 14:16
Formatting for a testimonial content box, credit to @savvyjackie
.testimonial-box-gray {
background-color: #eee;
border-left: 10px solid #ccc;
font-style: italic;
font-weight: 200;
margin-bottom: 30px;
padding: 35px;
}
@gspice
gspice / wap-agentpress-featured-listings-custom-text-field-banner.css
Last active August 29, 2015 14:16
Show custom text from AgentPress Listings - Featured Listings on WAP featured listings on home page
@gspice
gspice / change-comments-Genesis-child-themes.php
Last active August 29, 2015 14:16
Remove HTML tag info after comments and change label before comment block
//change the comments header
function wap_comment_form_defaults( $defaults ) {
$defaults['title_reply'] = __( 'Join the Conversation' );
return $defaults;
}
add_filter( 'comment_form_defaults', 'wap_comment_form_defaults' );
@gspice
gspice / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

<?php
add_filter( 'pre_get_posts', 'tgm_io_cpt_search' );
/**
* This function modifies the main WordPress query to include an array of
* post types instead of the default 'post' post type.
*
* @param object $query The original query.
* @return object $query The amended query.
*/
function tgm_io_cpt_search( $query ) {
@gspice
gspice / iHomeFinder-wap-search-bar-padding.css
Created July 13, 2015 12:47
Make that zero and make changes in padding on theme on search bar wrap padding
#ihf-main-container .mb-25 {
margin-bottom: 25px;
}
@gspice
gspice / APL-sort-listings-archive-state.php
Created July 21, 2015 15:21
AgentPress Listings - change sort order to be by state. In CPT, this is 'listing_state'
//change sort order to listing_state in main query
add_action( 'pre_get_posts', 'gsc_listing_state_sort_order' );
function gsc_listing_state_sort_order( $query ) {
if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'listing' ) ) {
$query->set( 'orderby', 'listing_state' );
}
@gspice
gspice / APL-sort-listings-by-price.php
Last active July 17, 2017 18:29
Finally solved! Code to sort AgentPress Listings by price. Thanks to Carrie Dils showing the thread in github for this -- update was suggested by Andrew Norcross that was added to the plugin code. A sortable column was added called listing_price_sortable. This allowed only the numeric value of the price to be stored separately and updated each t…
//change sort order to price high to low
add_action( 'pre_get_posts', 'gsc_listing_price_sort_order' );
function gsc_listing_price_sort_order( $query ) {
if( !is_admin() && is_post_type_archive( 'listing' ) ) {
$query->set( 'meta_key', '_listing_price_sortable' );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'desc' ); //list high to low
@gspice
gspice / remove-genesis-theme-settings-content-archive.php
Created July 29, 2015 16:17
Remove the Content Archives section from Genesis > Theme Settings.
add_action( 'genesis_theme_settings_metaboxes', 'themeprefix_remove_genesis_metaboxes' );
function themeprefix_remove_genesis_metaboxes( $_genesis_theme_settings_pagehook ) {
remove_meta_box( 'genesis-theme-settings-posts', $_genesis_theme_settings_pagehook, 'main' );
}