By default, options are auto-loaded. So all options with autoload: yes will be fetched very early. Your option will not need an additional query.
Also, database access is often faster and more reliable than file access. The options table is also usually included in database backups, and it can be exported in multiple formats. So stick with options.
What you should do: escape the URL. It might have been compromised, so …
if ( ! empty ( $options['div_background_url'] )
{
$section_background_url = esc_url( $options['div_background_url'] );
echo "<section style="background-image: url($section_background_url);"></section>";
}
You could move the custom styles to one style element in the head element.
Related Posts:
- Best practices for a Style/CSS based theme options page?
- How do I create my own admin button and theme settings page?
- Exclude stylesheet from admin
- How to mark an option as selected
- How can I show more than 15 themes at a time in the admin menu?
- How to find out if page_for_posts is showing (in order to style menu item)
- Problems to disable the comments for my statics pages
- How to include stylesheet in custom admin using parent_slug
- how to add version of style.css in wordpress
- How to make a theme with more than one CSS file?
- Add a page outside of the current theme?
- How to set two different themes on one WordPress? (Desktop vs. Mobile)
- Modify CSS via Theme Control Panel
- How to automatically highlight syntax of code in a post?
- The style.css stylesheet doesn’t contain a valid theme header
- How to make alert for new version on theme options?
- Change logo on each page of University Hub theme [closed]
- How to go about pre generating css file with variables from theme options
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Theme information in style.css being corrupted
- How to start learning CSS and theme development?
- Does uninstalling a WordPress theme delete its database values?
- 404 Error while accessing the font files
- How to set different settings for a mobile theme?
- Add a series of checkboxes to theme options
- Child Style.css not overriding parent theme style located in assets/css/main.css
- Disable Theme API / Front end (for API only environment)
- What’s the proper way to include inlined javascript-source?
- Creating a theme options page
- How can I display/hide certain content based on a Theme Option field?
- X-Axis of Site is Messed Up Because it is in Hebrew
- Posts and Pages not showing on admin, but showing in theme
- Style the archives/category sidebar widget via theme
- Custom CSS doesn’t work in edit mode
- Remove transparancy in Sydney theme’s headerimage
- How can I add class to every quote element?
- Twenty fifteen theme – change responsive menu condition
- Port existing Bootstrap site to WordPress?
- Different logo on homepage
- How to display message (with switch_theme hook) after deactivating My theme?
- How can we hide the parent’s theme url at the child themes details on a multisite?
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- How to switch theme if the current user is admin?
- Cannot apply custom css to IE in the theme
- Plugin and themes are adding the same stylesheets
- Child theme’s stylesheet cannot load [closed]
- Theming global variables – initializing in index.php but using in header.pho
- Is it good practice moving the main stylesheets after the plugin styles?
- Understanding the theme details in style.css
- Getting a ‘slide down’ js panel implemented within WP
- Calling external Libraries in WordPress
- Need a theme that let the posted content stretched maximum width [closed]
- What’s the default order used by WordPress to load CSS files?
- The requested theme does not exist. Stylesheet is missing – error after changing style.css name to my-styles.css in wp child theme?
- On a Https site, Css and Js Url are back to http after redirect the site
- How to integrate JSS to WordPress
- How to add some php code in header.php using plugin
- WordPress activate theme error $pagenow
- Increase content area width in TwentyFourteen [closed]
- header.php-tweak: How to do that getting Meta-Slider into the header-center?
- Setting a new default template for the creation of a page
- Display Headings on Index page in different font sizes
- Event Organiser breaks the theme [closed]
- Get data from Theme Options and use them into meta options field in custom post type
- List of categories instead of dropdown menu selector in admin options
- WordPress doesn’t recognise created theme
- Menu items do not “open” when mouse hover over them?
- I made new theme directory, why won’t it show up in admin GUI?
- My blog suddenly can’t find my stylesheet?
- WP Nanoplex 1.0.3 malfunction
- What is the most efficient way of adding additional functionaliy for admin only
- Whitespace between logo and site title in Twenty Twenty-Two
- CSS appears to not work on any WordPress theme
- Switching among theme customizations
- removing side space between para and container on generatepress?
- How Can I Disable WordPress Theme Self-Update?
- WordPress 404 on style.css but not on all pages
- How to implement theme option to change bootstrap 4 container from .container to .container-fluid
- how make wp include urls as https?
- Custom CSS is overwritten by WordPress?
- CSS in child theme isn’t working properly
- Strange Theme Error – parent style occasionally showing though child theme
- TwentyFourteen Theme : Changing grid layout
- Using two stylesheets for mobile compatibility
- Can i add wordpress editor to my custom theme option? [closed]
- EM in CSS different size on wordpress then elsewhere [closed]
- Random text changing to weird icons in both admin & front end
- How do I block a subdirectory from WordPress theming?
- How to Hide Blog Post Author?
- How can i limit wordpress post title characters in sidebar?
- I can’t install theme: theme install failed
- I don’t have permission to save the theme options I created myself?
- Commenting in CSS (//) equals “none”? [closed]
- How to change the standard width of a page
- Help with Divi logo not appearing for 10s
- Custom Theme Additonal CSS “” are transformed to “>” and “<”
- css on body tag in editor
- How do I remove the hamburger menu from the Twenty Twenty Four theme?
- I added a rating system on my blog post but instead of stars it shows boxes
- Apply Style variation to specific pages