Skip to content

Instantly share code, notes, and snippets.

@cobaltapps
cobaltapps / freelancer-add-custom-body-classes.php
Created September 13, 2017 13:31
Easily add custom body classes to your site using the following code inside your Child Theme's PHP files.
// Add a single body class through a string.
freelancer_add_body_classes( 'my-custom-body-class' );
// Add multiple body classes through an array.
freelancer_add_body_classes( array( 'my-custom-body-class', 'another-body-class' ) );
@cobaltapps
cobaltapps / freelancer-enqueue-custom-google-fonts.php
Last active November 4, 2020 13:27
The following code allows you to enqueue custom Google Fonts through your Child Theme's functions.php file.
add_action( 'wp_enqueue_scripts', 'freelancer_child_enqueue_google_fonts' );
/*
* Enqueue custom google fonts.
*/
function freelancer_child_enqueue_google_fonts() {
/*
* Example of the freelancer_google_fonts_url function
* with multiple Google Fonts and multiple subsets.
* Note that the fonts are required, but subsets are optional
@cobaltapps
cobaltapps / freelancer-google-fonts-url.php
Last active March 7, 2019 02:11
A Freelancer helper function that simplifies the process of enqueueing Google Fonts.
/*
* Example of the freelancer_google_fonts_url function
* with multiple Google Fonts and multiple subsets.
* Note that the fonts are required, but subsets are optional
* and only necessary if you're using non-default/custom subset
* (i.e.. something other than "latin").
*
$google_fonts_url = freelancer_google_fonts_url(
// An array of Google fonts with their respective styles.
array(
@cobaltapps
cobaltapps / freelancer-script-debugging.php
Created September 13, 2017 13:13
Paste in Child Theme's functions.php file to help in debugging Freelancer script files.
define( 'FREELANCER_SCRIPT_DEBUG' , true );
@cobaltapps
cobaltapps / freelancer-hooks-array.php
Last active March 7, 2019 02:12
An array list of the Freelancer Framework action hooks.
array(
'freelancer_before',
'freelancer_after',
'freelancer_before_header',
'freelancer_header',
'freelancer_after_header',
'freelancer_in_header',
'freelancer_in_header_main',
'freelancer_site_branding_logo',
'freelancer_site_branding_text',
@cobaltapps
cobaltapps / hamburger-menu-animation-effects-js
Created May 26, 2017 19:23
Hamburger Menu Animation Effects JS
jQuery(document).ready(function($) {
$('.hamburger').click(function() {
$(this).toggleClass('is-active');
});
});
@cobaltapps
cobaltapps / hamburger-menu-animation-effects-php
Created May 26, 2017 19:22
Hamburger Menu Animation Effects PHP
add_shortcode( 'hamburger_animation_icon', 'custom_hamburger_animation_icon_shortcode' );
function custom_hamburger_animation_icon_shortcode() {
ob_start();
custom_hamburger_animation_icon_content();
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
}
function custom_hamburger_animation_icon_content() { ?>
@cobaltapps
cobaltapps / hamburger-menu-animation-effects-css
Created May 26, 2017 19:21
Hamburger Menu Animation Effects CSS
Reports: 0
Home
Forums
>
Resources
>
How To's
>
How To Add CSS Animation Effects To Your Mobile Hamburger Menu Icons
@cobaltapps
cobaltapps / wp-enqueue-script-ui-draggable-code
Created May 26, 2017 19:06
WP Enqueue Script UI Draggable Code
<?php wp_enqueue_script( 'jquery-ui-draggable' ); ?>
@cobaltapps
cobaltapps / dynamik-vertical-toggle-shortcodes-tutorial-part-2
Created March 27, 2017 15:56
Code for a tutorial walking through some use-case scenarios of the Dynamik Responsive Vertical Toggle Menu Shortcode feature (Part 2).
Custom Hookbox:
Name - Custom Toggle Icon
Setup as "Shortcode"
Code:
<div class="responsive-menu-icon">
<i class="fa fa-ellipsis-h" aria-hidden="true"></i>