April 20, 2021

Software Mile.com

Latest Software News and Hacks

php line in a css, but the css comes from php

I had the issue, that I want to add a get_template_directory_uri() in a css line. This Css line is located in a boxes.php file.

$box_first = 'linear-gradient(rgba(0, 175, 227, .8), rgba(0, 175, 227, .8)),
url("/wp/wp-content/themes/my_theme/inc/img/boxes/box2.png") center;';

I also tried already to make a variable and put the variable in

url("$tpl_dir . '/inc/img/boxes/box2.png'")

, without any success..

Do you have any conclusions for me?

Many thanks and stay healthy, Dennis


Go to Source of this post
Author Of this post: Dennis
Title Of post: php line in a css, but the css comes from php
Author Link: {authorlink}