Skip to content

Instantly share code, notes, and snippets.

@jaredatch
jaredatch / gist:1243500
Created Sep 26, 2011
Enable search for bbPress 2
View gist:1243500
<?php
// Add Forums, Topics and Replies to search results
function my_add_bbp_to_search( $post_type ) {
$post_type['exclude_from_search'] = false;
return $post_type;
}
add_filter( 'bbp_register_forum_post_type', 'my_add_bbp_to_search' );
add_filter( 'bbp_register_topic_post_type', 'my_add_bbp_to_search' );
add_filter( 'bbp_register_reply_post_type', 'my_add_bbp_to_search' );
@jaredatch
jaredatch / gist:1256954
Last active Jun 26, 2022
Using the template_include filter in WordPress
View gist:1256954
<?php
add_filter( 'template_include', 'ja_template_check' );
function ja_template_check( $template ) {
if ( is_category() ){
// Get category information
$cat = get_query_var( 'cat' );
$category_info = get_category( $cat );
// News sub-categories, where 7 is the ID for News
@jaredatch
jaredatch / gist:1300302
Created Oct 20, 2011
Exclude category from search results in WordPress
View gist:1300302
<?php
add_filter( 'pre_get_posts', 'ja_search_filter' );
/**
* Exclude category 7 from search results.
*
* @since ?.?.?
* @author Jared Atchison
* @link https://gist.github.com/1300302
*
@jaredatch
jaredatch / gist:1337595
Created Nov 3, 2011
Add external link to admin menu in WordPress
View gist:1337595
<?php
/**
* Add external links to the admin menu
*/
add_action( 'admin_menu' , 'ja_new_admin_menu_items' );
function ja_new_admin_menu_items() {
global $submenu;
$url = get_bloginfo('url');
/**
@jaredatch
jaredatch / gist:1502448
Created Dec 20, 2011
Icrontic.com Dark and Condensed - FF
View gist:1502448
/*
* Icrontic.com "Dark and Condensed"
* Requires the Stylish browser addon - simply paste this!
*
* This is for FIREFOX. Chrome users: gist.github.com/1502454
* Stylish for FF sucks, so if you have problems try the Chrome version.
*/
body{font-size:62.5%!important;font-family:Arial,sans-serif!important;background-color:#000!important;color:#f5f5f5!important;line-height:1.7!important}a,a:visited,.meta .unmeta a{color:#6faaff!important;text-decoration:none!important}a:hover,.meta .unmeta a:hover{color:#e76105!important;text-decoration:underline!important}a:active,.meta .unmeta a:active{color:#ffa71b!important;text-decoration:underline!important}a:hover span{text-decoration:underline!important}.alt a,.alt a:visited{color:#6faaff!important}.alt a:hover{color:#e76105!important}.alt a:active{color:#ffa71b!important}.dark a{color:#6faaff!important}.dark a:hover{color:#e76105!important}.dark a:active{color:#ffa71b!important}.meta a{color:#6faaff!important}.meta a:hover{color:#e76105!important}.meta a:active{co
@jaredatch
jaredatch / gist:1502454
Created Dec 20, 2011
Icrontic.com Dark and Condensed - Chrome
View gist:1502454
/*
* Icrontic.com "Dark and Condensed"
* Requires the Stylish browser addon - simply paste this!
* This is for CHROME. Firefox users: gist.github.com/1502448
*/
body{font-size:62.5%;font-family:Arial,sans-serif;background-color:#000;color:#f5f5f5;line-height:1.7}a,a:visited,.meta .unmeta a{color:#6faaff;text-decoration:none}a:hover,.meta .unmeta a:hover{color:#e76105;text-decoration:underline}a:active,.meta .unmeta a:active{color:#ffa71b;text-decoration:underline}a:hover span{text-decoration:underline}.alt a,.alt a:visited{color:#6faaff}.alt a:hover{color:#e76105}.alt a:active{color:#ffa71b}.dark a{color:#6faaff}.dark a:hover{color:#e76105}.dark a:active{color:#ffa71b}.meta a{color:#6faaff}.meta a:hover{color:#e76105}.meta a:active{color:#ffa71b}h1,h2,h3,h4,h5,h6{font-family:Arial,sans-serif;line-height:1.3;color:#fff}h1,.headline h2{font-weight:700;font-size:2.6em}.Navigation{border-top:0;position:fixed;width:100%;z-index:9999}.Navigation a{color:white}.Navigation a:hover{color:#e76105;text-decoration:no
@jaredatch
jaredatch / gist:1502832
Created Dec 20, 2011
Icrontic.com only show new posts
View gist:1502832
#vanilla_discussions_index .Item { display: none; }
#vanilla_discussions_index .Item.New { display:block; }
@jaredatch
jaredatch / gist:1503468
Created Dec 20, 2011
Icrontic.com left vertical post bit
View gist:1503468
.Discussion .MessageList .Item .Meta { float: left; width: 180px; display:inline; margin:0; padding:0 10px 0 0; border-right:1px dotted #444; }
.Discussion .MessageList .Item .Message { float: right; width: 475px; display:inline; margin:25px 0 0 0; padding:0; clear:none; border-top:1px sotted #444;}
.Discussion .MessageList .Item .Comment { clear:both; overflow: auto; position: relative;}
.Discussion .MessageList .CommentInfo { display: block;clear:both; }
.Discussion .MessageList span.DateCreated { float: none; margin:0 0 10px 0 !important; display:block; position: relative !important;}
.Discussion .MessageList span.MItem { float:none !important; display:block !important; position: absolute; top:0; right: 0; }
.Discussion .MessageList .Comment .MItem { float: none !important; display:block !important; margin: 0 0 5px 0; }
.Discussion .MessageList .Comment .MItem.CommentQuote { position: absolute; top: 0; right: 35px; }
.Discussion .MessageList .Comment .MItem a.DeleteComment { position: absolute; top: -5px
@jaredatch
jaredatch / gist:1503694
Created Dec 20, 2011
Icrontic.com full width threads
View gist:1503694
#Panel .BigButton{ position: absolute; font-size: 12px; width: 150px; top: -80px; visibility:visible !important; display: block; left: 800px; }
#Panel { visibility:hidden; height:1px; }
.Dashboard #Panel { visibility: visible !important; height: auto;}
#Content { width: 960px; }
.Discussion .MessageList .Item .Message { width: 760px; }
.retainer { position: relative; }
@jaredatch
jaredatch / gist:1503964
Created Dec 21, 2011
Icrontic.com fluid width (forum)
View gist:1503964
.Vanilla #Body, .Vanilla .Head { width: 90%; }
.Vanilla #Content { margin: 0 auto !important; width: 97% !important; display:block; }
.Discussion .MessageList .Item .Meta { width: 18% !important; }
.Discussion .MessageList .Item .Message { width:79% !important; }
#Panel .BigButton { left: auto !important; }