Skip to content

Instantly share code, notes, and snippets.

@cyberwani
Forked from richtabor/wordpress-file-paths.php
Created August 30, 2019 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberwani/95a2381c5c4b3314d7beeb464d1c09df to your computer and use it in GitHub Desktop.
Save cyberwani/95a2381c5c4b3314d7beeb464d1c09df to your computer and use it in GitHub Desktop.
File path for a pre WordPress 4.7 asset:
<img src="<?php echo get_template_directory_uri(); ?>/images/filename.png" />
File path for a WordPress 4.7 + asset:
<img src="<?php echo get_theme_file_uri( ‘/images/filename.png’ ); ?>" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment