Skip to content

Instantly share code, notes, and snippets.

View elterko's full-sized avatar

elterko

  • Buenos Aires, Argentina
  • X @josemv
View GitHub Profile
@NicktheGeek
NicktheGeek / agentpress.php
Created January 10, 2013 20:27
Change AgentPress feature listing widget output
<?php
add_filter( 'agentpress_featured_listings_widget_loop', 'child_featured_listings_widget_loop' );
/**
* This code will replace the "," left behind in AgentPress feature listing widget after
* the listing detail IDs have been changed.
* Change the IDs to suit your needs.
*/
function child_featured_listings_widget_loop( $loop ){
@GaryJones
GaryJones / readme.md
Last active July 14, 2019 20:46
Custom Featured Post Widget plugin: Skeleton for amending the output of the Genesis Featured Post widget.
@jdspiral
jdspiral / gist:7e07144b7949e4bfb462
Last active June 10, 2019 10:01
This is a modified filter for editing the Genesis AgentPress Output
add_filter( 'agentpress_featured_listings_widget_loop', 'agentpress_featured_listings_widget_loop_filter' );
/**
* Filter the loop output of the AgentPress Featured Listings Widget.
*
*/
function agentpress_featured_listings_widget_loop_filter( $loop ) {
$loop = ''; /** initialze the $loop variable */
$loop .= sprintf( '<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'feature-community' ) ) );
@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
@nciske
nciske / custom-simple-sidebar.php
Last active November 29, 2016 22:29
Add a custom simple sidebar to a page, CPT archive, singular post, etc.
<?php
// Hooks to remove default sidebar and add our custom one
// Place me in functions.php or above genesis(); on a page template (in which case, no conditional is needed)
add_action('get_header','example_change_genesis_sidebar');
function example_change_genesis_sidebar() {
// change the conditional to determine where the swap occurs
// https://codex.wordpress.org/Conditional_Tags