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
/* | |
** ACF Image Helper | |
** | |
** @Param $imageId: int - image ID you are using | |
** @Param $size: string - image size you want to retrieve | |
** @Param $fieldName: string (optional) - name of the image field within the repeater | |
** @Return Array - image url and alt text for image | |
** | |
*/ | |
function tmbr_get_cropped_image( $imageId, $size ) { |
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
<?php | |
// Get all products | |
$args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'products', | |
'orderby' => 'menu_order', | |
'order' => 'ASC', | |
'no_found_rows' => true | |
); |
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
<!-- add to head of your theme.liquid after moving the files into the assets folder | https://www.woothemes.com/flexslider/ --> | |
<!-- add only if you theme is not already including Jquery--> | |
{{ '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' | script_tag }} | |
<!-- FLEX Slider css and .js --> | |
{{ 'flexslider.css' | asset_url | stylesheet_tag }} | |
{{ 'jquery.flexslider.js' | asset_url | script_tag }} | |
<!-- | |
add to schema json |
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
<?php | |
/* Credit Scotch.io : https://scotch.io/tutorials/a-guide-to-transients-in-wordpress */ | |
// Set variable for debugging | |
$usecache = true; | |
// Check if transient exists - use if it does | |
$projects = get_transient( 'tmbr_cached_projects' ); | |
if ( false === $projects || false === $usecache ) { |
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
/* | |
* @param - DEFAULTIMG - declared as global constant | |
* define("DEFAULTIMG", "/wp-content/themes/[theme-name]/public/images/[path-to-img.jpg]"); | |
* | |
*/ | |
// Add Featured image item to rss feed | |
function featuredtoRSS() { | |
global $post; |
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
/* | |
* BOOSTRAP GRID SHORT CODES | |
* Req : Bootstrap - http://getbootstrap.com/ | |
* add this code to functions.php or a shortcodes.php include | |
* Use in WISIWIG | |
--------------------------------------------- | |
[one_third] Content third [/one_third] | |
[one_third] Content third [/one_third] | |
[one_third] Content thrid [/one_third] |
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
/* | |
Add a data attr of event to a tag and push to analytics | |
@req : jquery | |
*/ | |
<a href="http://google.com" class="btn" data-event="footer-action">Download Now</a> | |
<script type="text/javascript"> | |
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
/* | |
@require | |
Jquery: https://jquery.com/ | |
*/ | |
function delete_cookie(name) { | |
document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; | |
} | |
// logout link |
OlderNewer