Skip to content

Instantly share code, notes, and snippets.

View bnecreative's full-sized avatar

Kerry Kline bnecreative

View GitHub Profile
@bnecreative
bnecreative / function.php
Last active October 20, 2022 20:06
Sweetness - Edit page heading wrapper background image and add category images
<?php //Don't copy this line...
/*
* Taxonomy CMB2 Fields
*
* Add custom fields to the Post Taxonomy
*
*/
add_action( 'cmb2_admin_init', function() {
@bnecreative
bnecreative / functions.php
Created September 18, 2021 18:15
Sweetness - Theme Color Palette
<?php // Don't copy this line...
/*
* Theme Color Palette
*
* Allows adjusting the default palette for WP blocks.
* Colors are also made available with CSS variables automatically.
*
* Location /includes/setup.php:188
*
@bnecreative
bnecreative / functions.php
Last active September 18, 2021 19:18
Sweetness - 3 column header layout
<?php //Don't copy this line...
/*
* WP Customizer Controls
* Remove existing Theme Option control as header
* layout is now manually defined.
*
*/
@bnecreative
bnecreative / functions.php
Created November 7, 2020 22:34
Sweetness Child Theme
<?php
/*
* Main Child Theme Functions
*
* @author Kerry Kline
* @copyright Copyright (c) 2020, Kerry Kline
* @link http://www.bnecreative.com
* @package Child Theme for BNE Sweetness v2 WordPress Framework
*
*/
@bnecreative
bnecreative / functions.php
Created September 30, 2020 20:16
BNE Panels - Autoload a panel on a certain page once per day using a cookie.
<?php // Don't copy this line...
// Sets up a cookie to autoload a BNE Panel */
add_action( 'wp', function() {
$page_id = 890;
$panel_id = 940;
$expires = 86400; // 86400 = 1 day
@bnecreative
bnecreative / site-banner.php
Last active March 16, 2020 18:15
Quick site banner
<?php
/*
* Plugin Name: Site Banner
* Version: 1.0
* Description: Adds a quick announcement banner to the top of your website.
*/
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
@bnecreative
bnecreative / bne_testimoinals_add_admin_fields.php
Created March 6, 2020 19:06
Testimonials - Add new field to Setting Page
<?php // Don't copy this line...
/*
* BNE Testimonials Settings API
*
* Add new settings to the settings page.
*
*/
function custom_testimoinals_add_settings() {
@bnecreative
bnecreative / functions.php
Last active March 4, 2020 16:36
Shortcode - Output custom page content
<?php // don't copy this line...
/*
* Custom page shortcode
*
* $atts['path'] The file that should be output relative
* to the current theme.
*
@bnecreative
bnecreative / functions.php
Created February 19, 2020 19:00
Sweetness - Add comments to page
<?php // don't copy this line...
/*
* Display comments in pages
*
* @hook page.php
*
*/
add_action( 'bne_page_footer', function() {
if( comments_open() || '0' != get_comments_number() ) {
@bnecreative
bnecreative / functions.php
Last active April 22, 2021 17:38
BNE Testimonials API - Set Google language argument
<?php // don't copy this line
/*
* BNE Testimonails Pro
* Adjust API arguments when requesting an external source
*
* return $api_data
*/
add_filter( 'bne_testimonials_api_source_args', function( $api_data, $source, $id, $key ) {