Skip to content

Instantly share code, notes, and snippets.

View themeblvd's full-sized avatar

Jason Bobich themeblvd

View GitHub Profile
@themeblvd
themeblvd / example.js
Last active July 3, 2018 14:53
Simple JavaScript function to escape HTML.
/**
* Escape HTML.
*
* @param {String} html HTML code.
* @return {String} Escaped html.
*/
function escape(html) {
const replace = {
'&': '&',
'<': '&lt;',
<?php
// Just set up an array and pass it to the function, and
// echo out the returned HTML.
$atts = array(
'link' => $videourl,
'thumb' => $videothumb,
);
echo themeblvd_shortcode_lightbox( $atts );
<?php
// Just set up an array and pass it to the function, and
// echo out the returned HTML.
$atts = array(
'link' => $videourl,
'thumb' => $videothumb,
);
echo themeblvd_shortcode_lightbox( $atts );
<?php
// First, let's just build a string of content.
// Method 1: If you using single quotes and you want to insert
// variables, you MUST open and close the string, and append chunks
// together with periods.
$str = '[lightbox link="' . $videourl . '" thumb="' . $videothumb . '"]';
// Method 2: When wrapping the string in double quotes, you can actually
@themeblvd
themeblvd / functions.php
Last active March 22, 2018 20:13
Adjust the icons for a toggle in Theme Blvd framework.
<?php
// Use the following with Jump Start 2.2.4+ (framework 2.7.4+)
/**
* Adjust icons used for opening and closing toggles.
*/
function my_toggle_icons( $icons ) {
// Icon for opening a closed toggle.
$icons['show'] = 'plus'; // Could also be more specific like `fal fa-plus`.
@themeblvd
themeblvd / functions.php
Last active March 22, 2018 18:25
Floating shopping cart for EDD from 2012
<?php
/**
* Checkout button.
*/
function themeblvd_checkout_button(){
global $edd_options;
return '<a href="' . get_permalink( $edd_options['purchase_page'] ) . '" class="checkout"><span class="inner">Checkout<i class="icon-shopping-cart"></i></span></a>';
@themeblvd
themeblvd / functions.php
Created February 8, 2018 21:30
Customize TinyMCE of Theme Blvd `editor` type options to be more like the default WP editor. Requies Theme Blvd Framework 2.7.2+.
<?php
/**
* Customize TinyMCE plugins with Theme Blvd `editor`
* type options.
*/
function my_editor_tinymce_plugins( $plugins ) {
$plugins = array(
'charmap',
'colorpicker',
@themeblvd
themeblvd / header.php
Created January 22, 2018 18:48
Jump Start's 2.1.15's header.php file for reference.
<?php
/**
* The Header for our theme.
*
* WARNING: This template file is a core part of the
* Theme Blvd WordPress Framework. It is advised
* that any edits to the way this file displays its
* content be done with via hooks, filters, and
* template parts.
*
<?php
if ( class_exists( 'Theme_Blvd_Options_Page' ) ) {
class My_Options_Page extends Theme_Blvd_Options_Page {
/**
* This method needs to be overwritten because
* the parent class uses add_theme_page() which
* can only add pages as subpages to the
* Appearance menu.
*/
@themeblvd
themeblvd / functions.php
Last active June 21, 2017 15:40
How to use the standard page template with a custom layout in Theme Blvd WordPress Framework.
<?php
/**
* HOW TO USE STANDARD PAGE TEMPLATE WITH LAYOUT BUILDER
*
* 1. Copy page.php to your child theme and rename
* it "template_builder.php".
*
* 2. Copy the commented code snippet from the top of
* parent theme template_builder.php in place of the
* comment snippet in your new child theme template_builder.php.