47 lines
No EOL
1.5 KiB
PHP
47 lines
No EOL
1.5 KiB
PHP
<?php
|
|
|
|
add_action( 'wp_enqueue_scripts', 'td_theme_styles' );
|
|
function td_theme_styles() {
|
|
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
|
|
wp_enqueue_script(
|
|
'google-maps',
|
|
'//maps.googleapis.com/maps/api/js?key=AIzaSyDHNT102YHu-TP50F78bPyvf5ia6K6cjU8&callback=initMap',
|
|
array(),
|
|
'1.0',
|
|
true
|
|
);
|
|
}
|
|
|
|
// Add google API key
|
|
function my_acf_google_map_api( $api ){
|
|
$api['key'] = 'AIzaSyDHNT102YHu-TP50F78bPyvf5ia6K6cjU8';
|
|
return $api;
|
|
}
|
|
|
|
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
|
|
|
|
|
|
// Related posts function
|
|
function atravelblog_related_posts() {
|
|
|
|
echo('<div class="related-posts posts section-inner">');
|
|
global $post;
|
|
$thisID = get_the_ID();
|
|
if ( get_the_category()[0]->name == 'Urlaub' ){
|
|
$tagebuch = new WP_Query( array( 'category_name' => 'Tagebuch' ) );
|
|
|
|
if ($tagebuch->have_posts()) :
|
|
while ( $tagebuch->have_posts() ) : $tagebuch->the_post();
|
|
global $post;
|
|
if($thisID == get_field('urlaub')->ID){
|
|
get_template_part( 'content', get_post_format() );
|
|
}
|
|
endwhile;
|
|
endif;
|
|
echo('<div class="clear"></div>');
|
|
echo('</div> <!-- /related-posts -->');
|
|
wp_reset_query();
|
|
|
|
}
|
|
|
|
} |