Skip to content

Instantly share code, notes, and snippets.

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() { ?>
jQuery(document).ready(function($) {
$('.hamburger').click(function() {
$(this).toggleClass('is-active');
});
});
@DalavanCloud
DalavanCloud / freelancer-hooks-array.php
Created March 7, 2019 02:12 — forked from cobaltapps/freelancer-hooks-array.php
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',
@DalavanCloud
DalavanCloud / freelancer-script-debugging.php
Created March 7, 2019 02:11 — forked from cobaltapps/freelancer-script-debugging.php
Paste in Child Theme's functions.php file to help in debugging Freelancer script files.
define( 'FREELANCER_SCRIPT_DEBUG' , true );
@DalavanCloud
DalavanCloud / freelancer-google-fonts-url.php
Created March 7, 2019 02:11 — forked from cobaltapps/freelancer-google-fonts-url.php
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(
@DalavanCloud
DalavanCloud / freelancer-enqueue-custom-google-fonts.php
Created March 7, 2019 02:10 — forked from cobaltapps/freelancer-enqueue-custom-google-fonts.php
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
@DalavanCloud
DalavanCloud / freelancer-add-custom-body-classes.php
Created March 7, 2019 02:10 — forked from cobaltapps/freelancer-add-custom-body-classes.php
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' ) );
@DalavanCloud
DalavanCloud / freelancer-custom-layout-function.php
Created March 7, 2019 02:10 — forked from cobaltapps/freelancer-custom-layout-function.php
An example of a custom function used to assign a custom layout to Freelancer using a conditional and the freelancer_layout filter hook.
add_action( 'wp_head', 'my_custom_layout' );
/*
* This would assign a No Sidebar layout to all "Pages"
* on your site, but have no effect on any other area.
*/
function my_custom_layout() {
// If NOT a "Page" then do nothing.
if ( ! is_page() )
return;
@DalavanCloud
DalavanCloud / freelancer-defining-custom-layouts.php
Created March 7, 2019 02:09 — forked from cobaltapps/freelancer-defining-custom-layouts.php
The following provides all of the ways to set the various layouts offered in Freelancer.
// Define a Right Sidebar layout.
add_filter( 'freelancer_layout', 'freelancer_return_right_sidebar' );
// Define a Left Sidebar layout.
add_filter( 'freelancer_layout', 'freelancer_return_left_sidebar' );
// Define a No Sidebar layout.
add_filter( 'freelancer_layout', 'freelancer_return_no_sidebar' );
// Define a No Sidebar Narrow layout.
@DalavanCloud
DalavanCloud / freelancer-hide-admin-pages.php
Created March 7, 2019 02:09 — forked from cobaltapps/freelancer-hide-admin-pages.php
Define the following constants through your Child Theme to hide the Theme Options and/or Theme License admin pages.
// Hide the Theme Settings admin page from the WP Dashboard sidebar.
define( 'FREELANCER_SETTINGS_PAGE_HIDE', true );
// Hide the Theme License admin page from the WP Dashboard sidebar.
define( 'FREELANCER_LICENSE_PAGE_HIDE', true );