Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Bobich themeblvd

View GitHub Profile
@themeblvd
themeblvd / example.js
Last active Jul 3, 2018
Simple JavaScript function to escape HTML.
View example.js
/**
* Escape HTML.
*
* @param {String} html HTML code.
* @return {String} Escaped html.
*/
function escape(html) {
const replace = {
'&': '&',
'<': '&lt;',
View example.php
<?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 );
View example.php
<?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 );
View example.php
<?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 Mar 22, 2018
Adjust the icons for a toggle in Theme Blvd framework.
View functions.php
<?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 Mar 22, 2018
Floating shopping cart for EDD from 2012
View functions.php
<?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 Feb 8, 2018
Customize TinyMCE of Theme Blvd `editor` type options to be more like the default WP editor. Requies Theme Blvd Framework 2.7.2+.
View functions.php
<?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 Jan 22, 2018
Jump Start's 2.1.15's header.php file for reference.
View header.php
<?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.
*
View functions.php
<?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 Jun 21, 2017
How to use the standard page template with a custom layout in Theme Blvd WordPress Framework.
View functions.php
<?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.
You can’t perform that action at this time.