Skip to content

Instantly share code, notes, and snippets.

View BoweFrankema's full-sized avatar

Bowe Frankema BoweFrankema

View GitHub Profile
@BoweFrankema
BoweFrankema / gist:10596814
Created April 13, 2014 18:47
WordPress Language Check
<?php
$currentlang = get_bloginfo('language');
?>
<nav class="collapse navbar-collapse" role="navigation">
<?php if($currentlang=="en-US"):?>
<?php
if (has_nav_menu('primary_navigation')) :
@BoweFrankema
BoweFrankema / example.php
Last active August 29, 2015 13:59
Titan Framework and LESS Variables
<?php
/**
* Pass variables from Titan Option to WP-LESS. This seems tricky.
*/
function cf_theme_variables()
{
if (class_exists('WPLessPlugin')){
$titan = TitanFramework::getInstance( 'cfcommunity-roots' );
$less = WPLessPlugin::getInstance();
$primary_brand = $titan->getOption( 'my_text_option' );
@BoweFrankema
BoweFrankema / buddypress-groups-loop.php
Created August 4, 2014 13:05
BuddyPress Groups Loop with specific groups based on ID
<?php
$args = array(
'include' => "4,5,2",
'max' => 5
);
if ( bp_has_groups( $args) ) :
?>
<ul id="groups-list" class="item-list">
<?php while ( bp_groups() ) : bp_the_group(); ?>
@BoweFrankema
BoweFrankema / base.php
Created August 14, 2014 13:40
BuddyPress Media and Roots Theme Lightbox solution
<?php get_template_part('templates/head'); ?>
<?php if ( function_exists( 'rtmedia_autoloader' ) && ! $rt_ajax_request ): ?>
<body <?php body_class(); ?>>
<!--[if lt IE 8]><div class="alert alert-warning"><?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?></div><![endif]-->
<?php
do_action('get_header');
// Use Bootstrap's navbar if enabled in config.php
@BoweFrankema
BoweFrankema / block-activity-types.php
Last active August 29, 2015 14:05
BuddyPress Block Activity Types Plugin replacement
<?php
//Block certain activity types from being added
function bp_activity_dont_save( $activity_object ) {
$exclude = array(
'updated_profile',
'new_member',
'new_avatar',
'friendship_created',
'joined_group'
);
@BoweFrankema
BoweFrankema / buddypress-activity-load.js
Created September 4, 2014 20:27
Fire a jQuery function on BuddyPress Activity Stream "Load More".
jQuery('ul#activity-stream').on('DOMNodeInserted', function() {
// Your jQuery Magic here
});
@BoweFrankema
BoweFrankema / photo-loop.php
Last active August 29, 2015 14:07
Simply user media loop
<?php if ( have_rtmedia () ) { ?>
<div class="widget">
<h4>Recent Photos</h4>
<div class="rtmedia-container">
<ul class="rtmedia-list rtmedia-list-media <?php echo rtmedia_media_gallery_class (); ?>">
<?php while ( have_rtmedia () ) : rtmedia (); ?>
<li class="rtmedia-list-item" id="<?php echo rtmedia_id(); ?>">
<a href ="<?php rtmedia_permalink(); ?>" title="<?php echo rtmedia_title(); ?>" class="<?php echo apply_filters( 'rtmedia_gallery_list_item_a_class', 'rtmedia-list-item-a' ); ?>">
<div class="rtmedia-item-thumbnail">
@BoweFrankema
BoweFrankema / bp-notification-snippet.php
Last active August 29, 2015 14:10
See full post on BP-Tricks.com for full instructions http://wp.me/p2ZyW5-Jr
<?php
function bp_tricks_member_intro_text() { { ?>
<script type='text/javascript'>
jQuery( document ).ready(function() {
// Member Directory Message
if (!jQuery.cookie('member-alert-message')) {
jQuery( "#member-welcome-message" ).show();
jQuery("#expand-hidden").click(function() {
jQuery( "#member-welcome-message" ).slideUp( "slow" );
// set the cookie for 24 hours
@BoweFrankema
BoweFrankema / bp-hide-widgets.php
Last active August 29, 2015 14:10
Hide BuddyPress widgets on Multisite install
<?php
//Remove the BP widgets everywhere except the main BuddyPress site.
add_action( 'bp_include', 'firmasite_bp_include_remove_widgets', 5 ); // priority is crucial
function firmasite_bp_include_remove_widgets() {
if ( !bp_is_root_blog() && !bp_is_multiblog_mode() )
remove_all_actions( 'bp_register_widgets' );
}
?>
@BoweFrankema
BoweFrankema / is-wordpress-class.php
Created December 12, 2014 10:35
Add a body class when the page is NOT a BuddyPress page
<?php
/**
* Add class when it's not a BuddyPress page
*/
function cfc_base_wordpress_page( $classes )
{
if ( ! is_buddypress() ) {
$classes[] = 'wordpress-page';
}