Skip to content

Instantly share code, notes, and snippets.

View themeblvd's full-sized avatar

Jason Bobich themeblvd

View GitHub Profile
<?php
/*
Plugin Name: Theme Blvd Shortcodes
Description: This plugin works in conjuction with the Theme Blvd framework to create shortcodes for many of the framework's internal elements.
Version: 1.4.1
Author: Theme Blvd
Author URI: http://themeblvd.com
License: GPL2
Copyright 2013 Theme Blvd
<?php
/*
Plugin Name: Theme Blvd Shortcodes
Description: This plugin works in conjuction with the Theme Blvd framework to create shortcodes for many of the framework's internal elements.
Version: 1.4.1
Author: Theme Blvd
Author URI: http://themeblvd.com
License: GPL2
Copyright 2013 Theme Blvd
<?php
function my_post_grid() {
global $wp_query;
global $post;
// Open first row
echo '<div class="row">';
$i = 1;
<?php
/**
* For themes built prior to framework 2.5, this puts
* the HTML markup back to the way it was originally
* for various framework hooks that were modified in 2.5,
* which changed the structural markup setup of the theme.
*/
/*------------------------------------------------------------*/
/* Header
<?php
/**
* Find all instances of image URL strings within
* a text block.
*/
function themeblvd_get_images( $str ) {
$protocols = array('http://', 'https://');
$extentions = array('.gif', '.jpeg', '.jpg', '.png');
$images = array();
@themeblvd
themeblvd / disable-resonsive-side-menu.php
Created August 3, 2014 20:01
Disable the new responsive side menu
<?php
/**
* Remove "tb-side-menu" class from main navigation
*/
function my_primary_menu_args( $args ) {
$args['menu_class'] = str_replace( 'tb-side-menu', '', $args['menu_class'] );
$args['menu_class'] = themeblvd_remove_trailing_char( $args['menu_class'] );
return $args;
}
add_filter( 'themeblvd_primary_menu_args', 'my_primary_menu_args' );
@themeblvd
themeblvd / mobile-toggle-start-at-mobile.php
Created August 3, 2014 20:12
By default Jump Start responsive toggle (javascript) will be applied for tablets and below. This snippet will change that to mobile and below.
<?php
/**
* Kick in mobile menu starting at mobile(>768),
* instead of tablet (>993)
*/
function my_js_locals( $locals ) {
$locals['mobile_menu_viewport_max'] = '767';
return $locals;
}
add_filter( 'themeblvd_js_locals', 'my_js_locals' );
@themeblvd
themeblvd / comments-legacy.php
Last active August 29, 2015 14:04
This filter on to put $args passed into comment_form() in comments.php of the theme to match what was set prior to framework 2.5. This will make updating older themes easier, so we don't have to update their comment form styling.
<?php
/**
* Put comment args back the way they were prior to framework 2.5
*/
function theme_comment_form_args( $args, $commenter, $req, $aria_req ) {
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$args = array(
'fields' => array(
@themeblvd
themeblvd / blog-meta-legacy.php
Created August 6, 2014 21:20
If an older theme wasn't already using a custom action for meta, this will default back to the way it was before framework 2.5
<?php
/**
* If an older theme wasn't already using a custom
* action for meta, this will default back to the
* way it was before framework 2.5
*/
function theme_meta( $input ) {
// Separator
$sep = apply_filters( 'themeblvd_meta_separator', '<span class="sep"> / </span>' );
@themeblvd
themeblvd / thumb-options-legacy.php
Last active August 29, 2015 14:04
In framework 2.5, featured image size options were limited to show/hide. However, framework will still process options onto old content files (if theme has them). To put this all back in place, simply add the options back with the following.
<?php
/**
* In framework 2.5, featured image size options were
* limited to show/hide. However, framework will still
* process options onto old content files (if theme has them).
* To put this all back in place, simply add the options
* back with the following.
*/
function theme_featured_image_options( $options ) {