Skip to content

Commit 8564073

Browse files
committed
Override Jeo template for better a11y
1 parent be9a6bc commit 8564073

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

themes/dcp/library/utils.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,15 @@ function cf7_descricao_custom_msg( $result, $tag ) {
506506

507507
return $html;
508508
}, 10, 1);
509+
510+
function override_jeo_templates($template) {
511+
global $post;
512+
513+
if (is_singular('map')) {
514+
return get_stylesheet_directory() . '/single-map.php';
515+
}
516+
517+
return $template;
518+
}
519+
520+
add_filter('single_template', 'override_jeo_templates', 20, 1);

themes/dcp/single-map.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php get_header(); ?>
2+
<main id="site-content" role="main">
3+
<h1 class="sr-only"><?php the_title(); ?></h1>
4+
<div class="jeomap map_id_<?php echo esc_attr( $post->ID ); ?>"></div>
5+
</main>
6+
<?php get_footer(); ?>

0 commit comments

Comments
 (0)