How to retrieve files path dynamically from child theme wp!

dynamic file location

From Child Theme :-

Here is the way to retrieve file path like CSS , JS , Images from child theme in wordpress.

<?php echo get_stylesheet_directory_uri(); ?>

Example:

<link href="<?php echo get_stylesheet_directory_uri(); ?>/css/your-file-name.css" rel="stylesheet">

<img src="<?php echo get_template_stylesheet_uri(); ?>/images/nstplanet.jpg" alt="Nst web creation">

From Parent Theme :-

Here is the way to retrieve file path from main/parent theme in wordpress.

<?php echo get_template_directory_uri(); ?>

Example:

<link href="<?php echo get_template_directory_uri(); ?>/css/your-file-name.css" rel="stylesheet">

<img src="<?php echo get_template_directory_uri(); ?>/images/nstplanet.jpg" alt="Nst web creation">

I hope this helps .. Thanks 🙂

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat