Skip to content

Instantly share code, notes, and snippets.

View BoweFrankema's full-sized avatar

Bowe Frankema BoweFrankema

View GitHub Profile
@BoweFrankema
BoweFrankema / Infinity.ini: Enqueue script on the front end
Created November 17, 2012 17:18
Enqueque a script anywhere on the front end through infinity.ini
[script]
;name script and location to path relative to theme folder
my-custom-js = "assets/js/my-custom-js"
[script_conditions]
;enqueue this script anywhere except the admin
is_not_admin = "my-custom-js"
@BoweFrankema
BoweFrankema / recent-topics-function.php
Created December 4, 2012 18:12
Add Recent Topics on BBpress 2+ Homepage
// ! // Add Recent Topics to BBPress
function recent_bbpress_topics() { { ?>
<!-- html -->
<h4>Recent Topics</h4>
<?php
if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )
bbp_get_template_part( 'bbpress/loop', 'topics' );
?>
<!-- end -->
<?php }}
@BoweFrankema
BoweFrankema / single-forum.php
Created December 10, 2012 16:10
Single Forum
<?php
/**
* Single Forum
*
* @package bbPress
* @subpackage Theme
*/
get_header(); ?>
@BoweFrankema
BoweFrankema / single-topic.php
Created December 10, 2012 16:13
Single Topic
<?php
/**
* Single Forum
*
* @package bbPress
* @subpackage Theme
*/
get_header(); ?>
@BoweFrankema
BoweFrankema / Custom like button
Created February 1, 2013 11:26
Adds button class to "like" button in BuddyPress
/**
* Custom jQuery Buttons
*/
function custom_like_buttons() { {
?>
<!-- html -->
<script>
// Adds button class to "like" button
jQuery(document).ready(function() {
//buttons
@BoweFrankema
BoweFrankema / cbox-sidebar.php
Created February 4, 2013 15:21
Add a new CBOX Sidebar
/**
* Register New Sidebar
*/
function cbox_register_alt_sidebar()
{
register_sidebar(array(
'name' => 'Alternative Sidebar',
'id' => 'alt-sidebar',
'description' => "The Alternative widget area",
'before_widget' => '<article id="%1$s" class="widget %2$s">',
@BoweFrankema
BoweFrankema / sidebar-html.php
Last active December 12, 2015 03:29
The HTML for a 2nd sidebar in the CBOX Theme
// Alt Sidebar
function cbox_alt_sidebar() { {
if ( !bp_is_blog_page() ): ?>
<aside id="sidebar-alt">
<?php
if ( is_active_sidebar( 'alt-sidebar' ) ) {
dynamic_sidebar( 'alt-sidebar');
} else { ?>
<div class="widget"><h4>Alternative Sidebar.</h4>
<a href="<?php echo home_url( '/' ); ?>wp-admin/widgets.php" title="Add Widgets">Add Widgets</a></div><?php
@BoweFrankema
BoweFrankema / cbox-sidebar.php
Last active December 12, 2015 03:29
The CSS needed to display the alternate sidebar properly in the CBOX Theme
// Alt Sidebar
function cbox_alt_sidebar_css() { {
if ( !bp_is_blog_page() ): ?>
<style>
#content {
width: 55%;
}
#sidebar {
width: 25%;
}
@BoweFrankema
BoweFrankema / template.php
Last active December 12, 2015 05:28
Only show slider box for logged in users.
<?php
/**
* Template Name: Features or Category Slider
*
* This template either displays Slides taken from the "Features" custom post type.
* Or Loops through posts from a certain category. This is based on the theme options set by
* the user.
*
* @author Bowe Frankema <bowe@presscrew.com>
* @link http://shop.presscrew.com/
@BoweFrankema
BoweFrankema / cbox-menu-item
Last active December 20, 2015 19:49
Adding a "My Home" menu item to your navigation menu. #cbox Full tutorial: http://commonsinabox.org/archives/3271
/**
* Add a Custom "My Profile" link to the Main Menu
*
*/
function cbox_custom_profile_menu_item ( $items, $args ) {
if ($args->theme_location == 'main-menu') {
$profilelink = '<li class="my-home-menu"><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Home') . '</a></li>';
$items .= '';
$items = $items . $profilelink;
}