This file contains hidden or 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 | |
// check if the flexible content field has rows of data | |
if( have_rows('flexible_content_field_name') ): | |
// loop through the rows of data | |
while ( have_rows('flexible_content_field_name') ) : the_row(); | |
if( get_row_layout() == 'paragraph' ): |
This file contains hidden or 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 | |
$rows = get_field('repeater_field_name' ); // get all the rows | |
$rand_row = $rows[ array_rand( $rows ) ]; // get a random row | |
$rand_row_image = $rand_row['sub_field_name' ]; // get the sub field value | |
// Note | |
// $first_row_image = 123 (image ID) | |
$image = wp_get_attachment_image_src( $rand_row_image, 'full' ); |
This file contains hidden or 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 | |
$rows = get_field('repeater_field_name' ); // get all the rows | |
$first_row = $rows[0]; // get the first row | |
$first_row_image = $first_row['sub_field_name' ]; // get the sub field value | |
// Note | |
// $first_row_image = 123 (image ID) | |
$image = wp_get_attachment_image_src( $first_row_image, 'full' ); |
This file contains hidden or 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 if( have_rows('repeater_field_name') ): ?> | |
<ul class="slides"> | |
<?php while( have_rows('repeater_field_name') ): the_row(); | |
// vars | |
$image = get_sub_field('image'); | |
$content = get_sub_field('content'); | |
$link = get_sub_field('link'); |
This file contains hidden or 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 | |
// check if the repeater field has rows of data | |
if( have_rows('repeater_field_name') ): | |
// loop through the rows of data | |
while ( have_rows('repeater_field_name') ) : the_row(); | |
// display a sub field value | |
the_sub_field('sub_field_name'); |
This file contains hidden or 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
global $wpdb; | |
$wpdb->query( " | |
DELETE FROM $wpdb->postmeta | |
WHERE meta_key = '_thumbnail_id' | |
" ); |
This file contains hidden or 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
define( 'ITSEC_TEST_MALWARE_SCAN_DISABLE_SSLVERIFY', true ); |
This file contains hidden or 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
function is_touch_device() { | |
try { | |
document.createEvent("TouchEvent"); | |
return true; | |
} catch (e) { | |
return false; | |
} | |
} |
This file contains hidden or 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 | |
$field_key = get_field('key_field'); | |
$field = get_field_object($field_key); | |
if( $field ): | |
echo '<ul id="filter" class="' . $field['key'] . '">'; | |
foreach( $field['choices'] as $k => $v ) { | |
echo '<li class="filter" data-filter="'. $k .'">'. $v .'</li>'; | |
} | |
echo '</ul>'; | |
endif; ?> |
This file contains hidden or 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
/* ======================================================================================================================== | |
iThemes Postcode | |
======================================================================================================================== */ | |
function my_translated_text_strings( $translated_text, $untranslated_text, $domain ) { | |
$translated_text = $untranslated_text; |