Skip to content

Instantly share code, notes, and snippets.

@cobaltapps
cobaltapps / dynamik-vertical-toggle-shortcodes-tutorial-part-1
Last active March 7, 2019 02:15
Code for a tutorial walking through some use-case scenarios of the Dynamik Responsive Vertical Toggle Menu Shortcode feature (Part 1).
Custom Hookbox:
Name - Custom Toggle Icon
Code:
<div class="responsive-menu-icon">
<i class="fa fa-bars" aria-hidden="true"></i>
<i class="fa fa-times" aria-hidden="true" style="display:none;"></i>
</div>
@cobaltapps
cobaltapps / genesis-logo-and-header-menu-swap-css
Created January 25, 2017 04:39
CSS snippet to position the Genesis Title Area right and the Header Widget Area left.
.title-area {
float: right;
}
.site-header .widget-area {
float: left;
text-align: left;
}
@cobaltapps
cobaltapps / dynamik-fixed-header-min-width-filter
Created January 23, 2017 11:50
Sets a custom minimum width for the fixed header functionality to remain in effect.
/*
* Sets a custom minimum width for the fixed header functionality to remain in effect.
* Paste this into your Custom Functions and then adjust the '920' value to your specific needs.
*/
add_filter( 'dynamik_fixed_header_min_width', 'custom_fixed_header_min_width' );
function custom_fixed_header_min_width() {
return '920';
}
@cobaltapps
cobaltapps / child-themer-add-header-footer-script-files.php
Last active March 7, 2019 02:17
Child Themer: Add both a header-scripts.js and footer-scripts.js file to your WordPress website.
@cobaltapps
cobaltapps / child-themer-include-custom-function-files.php
Last active March 7, 2019 02:18
Child Themer: Conditionally include both a front-end and back-end custom functions file for better custom coding compartmentalization.
// Include the front-end.php file only to non-admin pages.
if ( ! is_admin() )
include_once( get_stylesheet_directory() . '/custom/front-end.php' );
// Include the front-end.php file only to admin pages.
if ( is_admin() )
include_once( get_stylesheet_directory() . '/custom/back-end.php' );
@cobaltapps
cobaltapps / my-function-that-does-stuff-conditionally.php
Last active March 7, 2019 02:19
Learning To Code In PHP: The adding conditional code.
// Use this if working with Genesis
//add_action( 'genesis_before', 'my_function_that_does_stuff' );
// Use this if working with BB Theme
//add_action( 'fl_body_open', 'my_function_that_does_stuff' );
function my_function_that_does_stuff() {
if( is_page() ) {
@cobaltapps
cobaltapps / my-function-that-does-stuff.php
Last active March 7, 2019 02:19
Learning To Code In PHP: The basic add_action function.
// Use this if working with Genesis
//add_action( 'genesis_before', 'my_function_that_does_stuff' );
// Use this if working with BB Theme
//add_action( 'fl_body_open', 'my_function_that_does_stuff' );
function my_function_that_does_stuff() {
echo 'Hello World!';
@cobaltapps
cobaltapps / Beaver Builder Theme Page HTML
Last active March 7, 2019 02:19
A stripped down mock-up of what a standard page's HTML looks like when the Beaver Builder Theme is active.
<body class="page page-id-623 page-template page-template-my-templates page-template-testing-template page-template-my-templatestesting-template-php logged-in admin-bar no-customize-support fl-preset-default fl-full-width" itemscope="itemscope" itemtype="http://schema.org/WebPage">
<div class="fl-page">
<header class="fl-page-header fl-page-header-fixed fl-page-nav-right">
<div class="fl-page-header-wrap">
<div class="fl-page-header-container container">
@cobaltapps
cobaltapps / Beaver Builder Theme Hooks Map Functions
Last active June 3, 2022 03:17
Paste the following into your Beaver Builder Child Theme's functions.php file to enable an action hooks map on the front-end of your site, visible only to logged in admins.
// Display BB action hooks on front-end of site (visible to logged in admins only)
function bb_theme_hooks_map() {
if ( ! current_user_can( 'administrator' ) )
return;
$hooks = bb_theme_hooks_array();
foreach ( $hooks as $hook => $value ) {
@cobaltapps
cobaltapps / genesis-sample-2.2.3-fixed-header.css
Created May 13, 2016 18:46
Genesis Sample 2.2.3 Fixed Header CSS (Header Height reduced to 80px)
/* Fixed Header */
.site-header {
position: fixed;
width: 100%;
z-index: 999;
}
.site-inner {
margin-top: 80px;