Skip to content

Instantly share code, notes, and snippets.

@besimhu
besimhu / Move Gravity Forms jQuery calls to footer.php
Created March 15, 2015 15:57
Move Gravity Forms jQuery calls to footer
@besimhu
besimhu / .content.xml
Created August 25, 2017 18:58 — forked from rjspiker/.content.xml
AEM 6 Touch UI Show/Hide Checkbox Component Extension - Extension to the standard checkbox component. It enables hiding/unhiding of other components based on the selection made in the checkbox.
<enable
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
text="Enable"
id="enable"
value="true"
name="./enable"
class="cq-dialog-checkbox-showhide"
cq-dialog-checkbox-showhide-target=".button-option-enable-showhide-target"/>
<deleteEnable
@besimhu
besimhu / Mobile navigation overflow scrolling.scss
Last active June 14, 2016 22:16
Enable overflow scrolling on menus when they are fixed. This works best when you have a container that holds menu items. An unordered list will do just fine.
.mobile-navigation {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
@besimhu
besimhu / ACF Post Meta - Repeater chaining.php
Last active April 30, 2016 05:14
Get ACF repeater within a repeater without using ACF functions.
<?php
// get post ID
$pid = get_the_ID();
// get our repeater
$repeater = get_post_meta( $pid, 'acf_repeater_slug', true );
if ( !empty($repeater) ) {
for( $i = 0; $i < $repeater; $i++ ) {
@besimhu
besimhu / ACF Post Meta - Single.php
Created July 24, 2015 13:02
Get ACF field without using the ACF functions.
<?php
// get post ID
$pid = get_the_ID();
// acf field
$acf_field = get_post_meta( $pid, 'acf_field_slug', true );
@besimhu
besimhu / ACF Post Meta - Repeater.php
Last active April 30, 2016 05:14
Get ACF repeaters without using the ACF functions.
<?php
// get post ID
$pid = get_the_ID();
// get our repeater
$repeater = get_post_meta( $pid, 'acf_repeater_slug', true );
if( !empty($repeater) ) {
for( $i = 0; $i < $repeater; $i++ ) {
@besimhu
besimhu / ACF Post Meta - Options.php
Created July 24, 2015 13:13
Get ACF options without using ACF functions.
<?php
$acf_field_one = get_option( 'options_acf_field_one' );
$acf_field_two = get_option( 'options_acf_field_two' );
<body>
<header class="global-header">
<nav>
<ul>
<li><a href="#" title="">Nav Item</a></li>
<li><a href="#" title="">Nav Item</a></li>
<li><a href="#" title="">Nav Item</a></li>
</ul>
</nav>
</header>
<?php
function delete_its_transients() {
global $post;
if( $post->post_type == 'cpt' ) {
delete_transient( 'transient_name' );
}
}
add_action( 'save_post', 'delete_its_transients' );
[video src="http://www.video-url.com"][/video]