Skip to content

Instantly share code, notes, and snippets.

View rigelstpierre's full-sized avatar

Rigel St. Pierre rigelstpierre

View GitHub Profile
@rigelstpierre
rigelstpierre / flexslider.jquery.js
Created November 5, 2012 20:50
jQuery Show/Hide Elements
/*
* jQuery FlexSlider v2.1
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the GPLv2 license.
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Contributing author: Tyler Smith (@mbmufffin)
*/
@rigelstpierre
rigelstpierre / Wordpress Short Titles
Created October 14, 2011 05:51
A quick way to shorten wordpress titles.
function ShortenText($text) {
// Change to the number of characters you want to display
$chars_limit = 100;
$chars_text = strlen($text);
$text = $text." ";
$text = substr($text,0,$chars_limit);
$text = substr($text,0,strrpos($text,' '));
// If the text has more characters that your limit,
//add ... so the user knows the text is actually longer