Skip to content

Instantly share code, notes, and snippets.

View rmorse's full-sized avatar

Ross Morsali rmorse

View GitHub Profile
@rmorse
rmorse / filter-sf-pro-query.php
Last active January 7, 2024 03:09 — forked from dryan1144/filter-sf-pro-query.php
This modifies the $query_args object (rather than replacing it, which removes all the settings that are already in the object created by S&F).
<?php
function hck_filter_taxonomy_archives( $query_args, $sfid ) {
if( $sfid == 509 ) {
$query_args['post_type'] = 'articles';
}
return $query_args;
}
@rmorse
rmorse / Wordpress RSS 2.0 image enclosure
Last active August 29, 2015 14:06 — forked from supermethod/Wordpress RSS 2.0 image enclosure
Updated to to use a specific custom image size, with no fall back - better to have no image instead
function feedFilter($query) {
if ($query->is_feed) {
add_filter('rss2_item', 'feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
function feedContentFilter($item) {
@rmorse
rmorse / ellipsis.js
Created November 14, 2011 10:04 — forked from yuest/ellipsis.js
A Text Ellipsis jQuery Plugin For Firefox
// A jQuery plugin to enable the text ellipsis in firefox.
// see http://yue.st/notes/code/js/ellipsis.en.html
// usage:
// $('.elementsNeedEllipsis').ellipsis();
// the elements should be block level ('display: block' or 'display: inline-block')
//
// I think you should take care of resize event by yourself,
// just call $('.elem').ellipsis() again after element resized.
$.fn.ellipsis = function () {
$(this).css({'white-space': 'nowrap', 'overflow': 'hidden'});