Skip to content

Instantly share code, notes, and snippets.

bejes

Block or report user

Report or block bejes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bejes
bejes / spancount.js
Created Oct 19, 2012
Simple jquery plugin to insert spans in text and a defined character limit
View spancount.js
/**
* Plugin function to insert spans into text:
* usage
* $(document).ready(function() {
* $('p.charcount').charSpanCount(); });
* or $(document).ready(function() {
* $('p.charcount').charSpanCount({'charcount' : 15});
* });
*/
(function($) {
View gist:3507776
function get_deep_child_category()
{
$categories = get_the_category();
$maxId = 0;
$maxKey = 0;
foreach ( $categories as $key => $value )
{
if ( $value->parent > $maxId )
{
$maxId = $value->term_id;
@bejes
bejes / gist:1480933
Created Dec 15, 2011 — forked from davemac/gist:1480832
WordPress get the category parent slug and include in body_class
View gist:1480933
<?php
if (is_single() || is_category()) {
$category = get_the_category();
$nice_name=array();
foreach($category as $c)
{
$parent = $c->category_parent;
$parent_cat =get_category($parent);
$nice_name[]= $parent_cat->category_nicename;
You can’t perform that action at this time.