Skip to content

Instantly share code, notes, and snippets.

@8lane
8lane / gist:a2b97065d9116f8e801e
Created December 10, 2014 15:07
Remove 'Toggle' Text from IP.Board Shoutbox App #2
<a class='toggle right' href='#' title='{$this->lang->words['toggle_shoutbox']}'></a>
@8lane
8lane / gist:07daf64d3476da1fe950
Created December 10, 2014 15:07
Remove 'Toggle' Text from IP.Board Shoutbox App
<a class='toggle right' href='#' title='{$this->lang->words['toggle_shoutbox']}'>{$this->lang->words['toggle_shoutbox']}</a>
@8lane
8lane / gist:5a0b991c16456064c263
Last active August 29, 2015 14:10
Fix wordpress not adding custom post types to category archives
/*
* Fix wordpress not adding custom post types to category archives
*/
function add_custom_types_to_tax( $query ) {
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
$post_types = get_post_types();
$query->set( 'post_type', $post_types );
return $query;
}
}
@8lane
8lane / gist:422fe8bfbd8a916c0b63
Created November 20, 2014 10:16
EDD Easy Digital Downloads Get number of category items
$get_themes = get_term(2, 'download_category' );
echo $get_themes->count;
@8lane
8lane / gist:d56490a0e65c522ece78
Created November 11, 2014 23:01
Xenthemes Boilerplate Hero Message Global
<!-- :: Xenthemes Message :: -->
<xen:if is="!{$visitor.user_id} && @xt_message_guest == 1">
<xen:include template="xt_message_guest" />
</xen:if>
<xen:if is="{$visitor.user_id} && @xt_message_member == 1">
<xen:include template="xt_message_member" />
</xen:if>
@8lane
8lane / forum_only
Last active August 29, 2015 14:09
Xenthemes Boilerplate Hero Message Forum Only
<!-- :: Xenthemes Message :: -->
<xen:if is="{$contentTemplate} == 'forum_list'">
<xen:if is="!{$visitor.user_id} && @xt_message_guest == 1">
<xen:include template="xt_message_guest" />
</xen:if>
<xen:if is="{$visitor.user_id} && @xt_message_member == 1">
<xen:include template="xt_message_member" />
</xen:if>
</xen:if>
@8lane
8lane / gist:36500183599a3cfe0686
Created September 5, 2014 23:09
Wordpress Easy Digital Downloads - Get Download tags in PHP
<?php echo get_the_term_list( get_the_ID(), 'download_tag', 'Tags: ', ', ', '') ?>
@8lane
8lane / gist:3d75f1883525cbe540a3
Last active August 29, 2015 14:05
Set/Read a cookie with Javascript in xenForo forum software
var cookieExpiry = new Date(new Date().getTime() + 365 * 86400000); // 1 year from now
$.setCookie('Name','Value',cookieExpiry);
$.getCookie('Name');
@8lane
8lane / gist:2c7a66bb8553c784158d
Created August 21, 2014 17:34
Lazy Load CSS Background Images
$(window).load(function(){
$('.lazyload').each(function() {
var lazy = $(this);
var src = lazy.attr('data-src');
lazy.css('background-image', 'url("'+src+'")');
});
});
@8lane
8lane / gist:185b13aa521d349cfd1c
Created July 14, 2014 10:30
Get total amount of tickets from WooThemes SupportPress theme
function totalTickets() {
global $wpdb;
$wpdb->set_blog_id(2);
$wpdb->set_prefix($wpdb->base_prefix);
$countTickets = count( get_posts( array('post_type'=>'ticket','nopaging' => true)));
$wpdb->set_blog_id(1);