Home › Forums › General Issues › Post and category image background › Reply To: Post and category image background
I think you’d need to bundle it all into one function.
$bg_image = get_field('background_image', $post_id);
if (!$bg_image) {
// get the background image from options page
}
$css = "body { background-image: url('$bg_image')!important; }";
wp_add_inline_style( $handle, $css );
But I may be misunderstanding how you’re adding the image that’s part of theme options.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.