This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************ | |
* Include partial file. | |
* @param string $sFilePath The component to include | |
* @param array $aScopeVariables An array of variables to make available in the component | |
* @param boolean $bReturn Return the markup instead off outputting it? | |
************************************/ | |
function get_partial( $sFilePath, $aScopeVariables = [], $bReturn = false ) { | |
ob_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************ | |
* Include component file. | |
* @param string $sFilePath The component to include | |
* @param array $aScopeVariables An array of variables to make available in the component | |
* @param boolean $bReturn Return the markup instead off outputting it? | |
************************************/ | |
function get_component( $sFilePath, $aScopeVariables = [], $bReturn = false ) { | |
ob_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************** | |
* Includes the page builder file | |
* @param string $sFilePath The builder to include | |
* @param string $sFieldName ACF field name | |
* @param array $aScopeVariables An array of variables to make available in the component | |
***************/ | |
function get_builder( $sFilePath, $sFieldName = 'blocks', $aScopeVariables = [] ) { | |
ob_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************ | |
* Include SVG file. | |
* @param string $sFilePath The path of the SVG file | |
* @param boolean $bReturn Return the output instead of echoing (optional) | |
************************************/ | |
function get_svg( $sFilePath = NULL, $bReturn = false ) { | |
$sFileContents = NULL; | |
$sSvgPath = THEME_DIR_FILEPATH . '/media/dist/img/' . $sFilePath . '.svg'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************ | |
* Include Imgix image | |
* @param array $aImageScope The image settings | |
* @param array $aClasses Apply classes to the image (optional) | |
* Sandbox: https://sandbox.imgix.com/ | |
* API Reference: https://docs.imgix.com/apis/rendering | |
* Notes: | |
- Do not include `dpr` param in `settings`, instead set a maximum DPR support in `max_dpr` parameter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scroll.on( 'call', ( value ) => { | |
if ( value === 'exampleNameOne' ) { | |
console.log( 'Example #1' ); | |
} | |
if ( value === 'exampleNameTwo' ) { | |
console.log( 'Example #1' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************** | |
* Browser detection and output | |
**************************************************************/ | |
function fnShowBrowserVersion() { | |
var sDomainName = window.location.hostname; | |
// Restrict to non-production sites | |
if ( sDomainName.search( ".local" ) >= 1 || sDomainName.search( ".flywheelsites" ) >= 1 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************** | |
* Scroll to ID (hash links) | |
**************************************************************/ | |
function fnScrollToID( oEvent ) { | |
// Prevent default anchor behaviour | |
oEvent.preventDefault(); | |
// Get offset value (optional) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( 'body' ).bind( 'mousewheel', function( e ) { | |
if ( e.originalEvent.wheelDelta / 120 > 0 ) { | |
console.log( 'Scrolling up' ); | |
} | |
else { | |
console.log( 'Scrolling down' ); | |
} | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# Password protect | |
# ---------------------------------------------------------------------- | |
AuthType Basic | |
AuthName "Password Protected Area" | |
AuthUserFile /dir/to/root/.htpasswd | |
Require valid-user |
OlderNewer