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 | |
function shortcode_function_name() { | |
ob_start(); | |
// Code | |
...youre php/html code | |
$content = ob_get_clean(); | |
return $content; | |
} |
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 | |
$args = array ( | |
'posts_per_page' => '-1', | |
); | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { | |
while ( $query->have_posts() ) { | |
$query->the_post();?> | |
<?php } |
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 | |
if( have_rows('left_box_items') ): while ( have_rows('left_box_items') ) : the_row();?> | |
<?php the_sub_field('sub_field_name'); ?> | |
<?php endwhile;endif;?> |
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 $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?> | |
<li style="background-image:url(<?php echo $image[0]; ?>)"> |
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
$('.hp_videos .modal').on('hidden.bs.modal', function (e) { | |
var url = $(this).find('iframe').attr('src'); | |
$(this).find('iframe').attr('src',url); | |
console.log('close'); | |
}); | |
$('.hp_videos .modal').on('shown.bs.modal', function (e) { | |
var url = $(this).find('iframe').attr('src'); | |
$(this).find('iframe').attr('src',url); | |
console.log('open'); | |
}); |
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
// create marker | |
var templateDir = "<?php bloginfo('stylesheet_directory') ?>"; | |
var iconBase = templateDir + '/images/map_icon.svg'; | |
var marker = new google.maps.Marker({ | |
position : latlng, | |
map : map, | |
icon: iconBase | |
}); |
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
function my_custom_switcher( $items, $args ){ | |
if( $args->theme_location == 'primary' ) { | |
$languages = icl_get_languages('skip_missing=0&orderby=code'); | |
if(!empty($languages)){ | |
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
http://www.duepi.biz/blog/2014/09/acf-options-page-with-wpml-support/ |
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
http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height | |
<?php | |
$counter == 0; | |
// check if the repeater field has rows of data | |
if( have_rows('logos') ): ?> | |
<?php | |
// loop through the rows of data |