1

I'm building a dynamic page template for wordpress (which means it has to work at least 4 different domain without changing anything like links etc.) and I added a custom css link like this:

 <link type="text/css" rel="stylesheet" href="https://mywebsite.com/wp-content/themes/mytheme/css/page-food.css">

I can reach the server home in a variable like $home_path. Or the theme main folder like $theme_path. So is there any possible way to add the href a PHP variable?

I mean

<link type="text/css" rel="stylesheet" href="$theme_path/css/page-food.css">

2 Answers 2

4

just add php start and end tags there

<link type="text/css" rel="stylesheet" href="<?=$theme_path?>/css/page-food.css">
Sign up to request clarification or add additional context in comments.

Comments

1
wordpress css call in daynamic path 

<link href="<?php echo get_template_directory_uri(); ?>/css/fonts.css" type="text/css" rel="stylesheet">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.