It can be done with a custom field and the CSS should be changed to .php
file:
$image = get_post_meta( $post->ID, "ImagePathFromCustomField", true );
if ( $image != '' ) {
?>
<style type="text/css">
.bg-image {
background-image: url(<?php echo $image; ?>);
background-repeat: repeat;
}
</style>
<?php
}
Related Posts:
- Simple/basic use of get_current_screen
- Is it possible to be more page/post specific with admin_enqueue_script?
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Some questions about how proper add 2 CSS file in a WordPress theme?
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- why can’t i add front.css to my frontpage.php
- Advanced method to control cache of enqueued style/script
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- Issues with title-tag and document_title_parts
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to get woocommerce inventory status [closed]
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- How do I create a new WP admin color scheme?
- Add attribute to link tag that’s generated through wp_register_style?
- Organize functions.php
- How to override functions.php in child theme?
- TinyMCE custom stylesheets for different post types
- Change parent theme file function in child themes functions.php
- Remove “says” from comments
- Child Theme Not Overriding Parent Theme
- Displaying Widgets
- Changing itemprop from logo to image on custom logo?
- Show excerpt for only first post in query
- How to add css class to image attached in all the posts?
- How to call custom function from functions.php in site-wide template files?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- Add class or ID to any WordPress function
- Weekly background code not working
- Is there a way to add a class to non current menu item?
- How to enable template page only for a post id page
- Add caption functionality to custom WordPress theme
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Child Theme files – what is needed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Best practices regarding the creation of custom widgets?
- WordPress Menuing Question :focus
- Add Custom Background Properties to Customizer
- enqueue styles for only mobile wp
- Jquery implementation not working on page reload
- Redirect to another page using contact form 7? [closed]
- How to stop wordpress from injecting hard-coded style into image attachments with captions
- Is my code correct to enqueue CSS on a specific page?
- Check if the image size is available and if not use ‘full’ image size
- header_image() with CSS
- Remove Custuomize Sections
- Define PHP variable from a seperate API if statement
- get_pages() Returns Only One Item
- Split Media Queries in different files!
- problem loading stylesheets to wp_head dynamically
- Parent theme styles overriding child theme CSS [closed]
- Theme JS is available but theme CSS isn’t
- Proper Way to Load stylesheet on Condition
- Getting the teaser text without overriding global variables
- Default Nav Highlight
- Custom styles in Tiny MCE with an external CSS file
- get_template_directory_uri() links to child theme not parent
- “options.php” not found
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- What is the correct way to include my new functions and scripts in WordPress?
- Getting out side of wp root folder from function.php using absolute path
- wp_nav_menu work in functions.php but not in the theme
- contact form in template with jquery,validate and ajax
- current_page_item is missing inside wp_nav_menu
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Can’t change theme name
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Exclude specific post from query
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- Can’t load assets
- CSS style and app.js not loading
- Why does echo on functions.php not yield result in source code?
- How do I make a custom “Read More Blogs” button for my blog page
- Setting Up Child Theme To Take Priority
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- CSS disabled after getting rid of emoji
- How to add styles in existing function?
- Woocommerce – Switching Price for Category
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Child Theme not loading multiple stylesheets
- How to retrieve image IDs from shortcode content?
- Correct way of Enqueue self hosted fonts in sass project
- Help with is_page() and calling css for specific pages in a Child Theme
- Class::$template_dir_path=get_template_directory();
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- Different body image backgrounds on different pages, posts and categories
- Language switcher for subdomains
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- wp_nav_walker that interacts with widgets to setup mega menu
- Preventing PHP Execution in Parent Theme
- Functions.php in child theme that loads CSS file breaks website
- Allow tags and attributes in post and pages content
- Syling Custom Fields echo’s from from functions.php
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Add custom css to theme
- How to get postId from the argument $block when register_block_type()?
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- Setcookie not setting cookies anywhere except admin