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 | |
function my_theme_default_gallery_style() { | |
return false; | |
} | |
add_filter( 'use_default_gallery_style', 'my_theme_default_gallery_style' ); |
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 | |
function my_theme_init() { | |
register_taxonomy_for_object_type( 'post_tag', 'page' ); | |
} | |
add_action( 'init', 'my_theme_init' ); | |
function my_theme_tags_support_query( $wp_query ) { | |
if ( $wp_query->get( 'tag' ) ) { | |
$wp_query->set( 'post_type', 'any' ); |
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 () { | |
$("#btn").on('click', function() { | |
$('html, body').animate({ | |
scrollTop: $("#scrollToElementId").offset().top | |
}, 400); | |
}); | |
}); |
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 | |
$the_query = new WP_Query( array( | |
'post_type' => 'trip', | |
'post_per_page' => $limit, | |
'meta_key' => 'wpcf-start-date', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC', | |
'meta_query' => array( | |
'key' => 'wpcf-start-date', | |
'value' => current_time( 'timestamp' ), |
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 $icl_object_id = icl_object_id( get_the_ID(), 'post', true ); ?> | |
<a href="<?php echo get_permalink( $icl_object_id ); ?>"> | |
<?php _e( 'Read more', 'your_domain' ); ?> | |
</a> |
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 | |
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'image-size' ); | |
$url = $thumb['0']; |
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 | |
function get_current_url() { | |
global $wp; | |
return add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) ); | |
} |
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 | |
function change_posts_per_page( $query ) { | |
if ( is_main_query() && is_archive() ) { | |
$query->set( 'posts_per_page', -1 ); | |
} | |
} | |
add_action( 'pre_get_posts', 'change_posts_per_page' ); |
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
var map; | |
var mapOptions = { | |
zoom: 15, | |
scrollwheel: false, | |
center: new google.maps.LatLng( latitude, longitude ) | |
}; | |
map = new google.maps.Map( | |
document.getElementById( 'map-canvas' ), | |
mapOptions |
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 | |
$post_idx = 0; | |
if ( have_posts()) { | |
while ( have_posts()) { | |
the_post(); | |
// $post_idx is not available in content-page.php | |
get_template_part('content', 'page'); | |
$post_idx += 1; | |
} |