Home › Forums › Add-ons › Options Page › ACF With PHP Based Style Sheet › Reply To: ACF With PHP Based Style Sheet
This seemed like a good solution but for whatever reason I cannot get it going…
I have tried various permutations and still the variable is not being passed…
Not sure how to answer your question how am I calling it…did I not give enough information above?
Right now I am trying something like this and still no luck
<?php // For GSL
include("../../../../wp-load.php");
header('Content-Type:text/css');
?>
<?php
global $post;
$variable = get_field('lp_background', $post->ID); ?>
?>
.custom #landing_banner .wrapper { background: url('<?php $variable ?>') transparent no-repeat center top; background-size: cover; }
Are you able to provide a better code block using the actual fields name I am showing in my example?
Any help is appreciated!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.