Skip to content

Commit 96d33ea

Browse files
author
Roni Laukkarinen
committed
Use get_theme_file_path in SVGs to make them work behind protected urls
1 parent 834f9f1 commit 96d33ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

footer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<footer id="colophon" class="site-footer">
1717
<div class="site-info">
1818
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'air' ) ); ?>"><?php printf( esc_html__( 'Proudly powered by %s', 'air' ), 'WordPress' ); ?></a>
19-
<span class="theme-info"><?php printf( esc_html__( 'Lightweight like %1$s itself. You are using version %2$s', 'air' ), '<i>air</i>', esc_attr( AIR_VERSION ) ); ?> &mdash; <a href="https://github.com/digitoimistodude/air"><?php echo file_get_contents( esc_url( get_theme_file_uri( '/svg/github.svg' ) ) ); ?> GitHub</a></span>
19+
<span class="theme-info"><?php printf( esc_html__( 'Lightweight like %1$s itself. You are using version %2$s', 'air' ), '<i>air</i>', esc_attr( AIR_VERSION ) ); ?> &mdash; <a href="https://github.com/digitoimistodude/air"><?php echo file_get_contents( esc_url( get_theme_file_path( '/svg/github.svg' ) ) ); ?> GitHub</a></span>
2020
</div><!-- .site-info -->
2121
</footer><!-- #colophon -->
2222
</div><!-- #page -->
2323

2424
<?php wp_footer(); ?>
2525

26-
<a href="#page" class="top"><span class="screen-reader-text"><?php echo esc_html_e('Back to top', 'air'); ?></span><?php echo file_get_contents( esc_url( get_theme_file_uri( '/svg/chevron-up.svg' ) ) ); ?></a>
26+
<a href="#page" class="top"><span class="screen-reader-text"><?php echo esc_html_e('Back to top', 'air'); ?></span><?php echo file_get_contents( esc_url( get_theme_file_path( '/svg/chevron-up.svg' ) ) ); ?></a>
2727

2828
</body>
2929
</html>

header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
<div class="site-branding">
3131
<?php
3232
if ( is_front_page() && is_home() ) : ?>
33-
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span><?php echo file_get_contents( esc_url( get_theme_file_uri( '/svg/logo.svg' ) ) ); ?></a></h1>
33+
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span><?php echo file_get_contents( esc_url( get_theme_file_path( '/svg/logo.svg' ) ) ); ?></a></h1>
3434
<?php else : ?>
35-
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span><?php echo file_get_contents( esc_url( get_theme_file_uri( '/svg/logo.svg' ) ) ); ?></a></p>
35+
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span><?php echo file_get_contents( esc_url( get_theme_file_path( '/svg/logo.svg' ) ) ); ?></a></p>
3636
<?php
3737
endif;
3838
$description = get_bloginfo( 'description', 'display' );

0 commit comments

Comments
 (0)