php - Difference between get_template_directory_uri() and upload images to wordpress site -


i'm working wordpress , want understand difference between uploading image in media folder on wordpress dashboard in media folder, , use get_template_directory_uri(); retrieve theme directory , display images have stored in image folder so:

<img src="<?php echo get_template_directory_uri();?>/img/image.png">

are there of these solution better other?

thank you

you should thinking in terms of is content / resources static or dynamic?

if resource part of theme (ie. static), best use:

<img src="<?php echo get_template_directory_uri();?>/img/image.png"> 

if part of content , can changed wordpress user, use media uploads. alternative use options framework allow user change static resources.


Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -