Nothing prevents you from retrieving your option in several places. You can do several get_option()
calls or create global variable and assign your value to it once.
It is hard to come up with specific example without knowing what exactly you store in option and which classes you want to generate for your markup.
Update
One of the ways to get it done. Depending on how you organize code you might need to declare variables as global
:
$options = get_option('sample_theme_options');
$sidebar_width = $options['sidebar_width']; // let's say we have stored integer '2' here
$column_width = 8 - $sidebar_width; // total width minus sidebar
// and then in template
echo "<div class="main-{$column_width}col"> main </div>";
echo "<div class="sidebar-{$sidebar_width}col"> sidebar </div>";
Related Posts:
- PageLines theme: how to change the background color of the main content vs. entire page?
- Using theme options to change link colours
- How to get a value for admin css color either gray or blue
- Link theme options page using ACF to styles
- Using browser detection and the body_class() function to modify css
- How to insert spaces/tabs in text using HTML/CSS
- How to change btn color in Bootstrap
- Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4
- How to make the HTML link activated by clicking on the
- ?
- force footer on bottom on pages with little content
- Dynamically change color to lighter or darker by percentage CSS
- How do I right align div elements?
- CSS text-align not working
- What is the difference between “screen” and “only screen” in media queries?
- How to have an anim gif on a link and play it on hover and reset
- How can I make Bootstrap columns all the same height?
- Align text to the bottom of a div
- How to make a
- display in a horizontal row
- Using font awesome in codepen
- using media queries with LESS
- How can I apply styles to multiple classes at once?
- Responsive Canvas in Bootstrap column?
- CSS rotation cross browser with jquery.animate()
- How can I center
- into a div?
- Are there Gutenberg container blocks?
- How to add a “last” class to the last post in loop.php?
- How do i use fontawesome icons in TinyMce editor?
- Add a preview to a WordPress Control Panel
- Why won’t child theme’s style.css override plugin’s css
- some things in child theme css not overriding parent
- Is it possible to create a full width row in WordPress’s editor window? [closed]
- Load custom css after bootstrap
- How do I find (index) file in order to change style on CSS?
- Highlighting the current page in a navigation menu which links are generated with a custom loop?
- Remove sticky behavior from top navigation on twenty fourteen theme?
- Looking for methods to Check if File Exist
- Include CSS with PHP without including wp-load?
- Loading different stylesheet on WordPress pages?
- How to change the style.css?ver=5.4.1 in WordPress?
- Redoing home page but changes not taking effect
- Gallery CSS Problem
- Using if/else statements with output from theme options
- Shrink Header Image on Scroll
- Correct way to output styles gathered from theme or plugin settings?
- Remove extra white space bellow and above product short description in storefront woocommerce
- Inline Style attribute getting stripped off
- Can’t Display Table Headers in Responsive table layout
- Following Web Performance Optimization techniques to output static and dynamic css
- Edit css for search results page
- Archive pages have smaller font then the rest of my website [closed]
- CSS not applying in admin
- Why is the CSS horizontal alignment for divs inside div container not displayed in my WP Theme?
- Changing blog style [closed]
- How do I use inline styling with WordPress?
- node.js and webpack throws error when trying to setup node to watch theme folder for saved changes
- My CSS suddenly doesn’t load anymore [closed]
- why is my paypal button not clicable [closed]
- How can I move my custom css to the very bottom of the head section?
- Wrong image path within inline styles in the head
- How can I selectively insert a header for my shop page in woocommerce? [closed]
- WordPress Caption Formatting
- Child Theme style.css changes aren’t showing. Parent “style-less.css” over rides it, and won’t update
- The Global Styles missing
- Invert porfolio item order
- Broken css on mobile phones only on https
- WordPress CSS completely broken on IIS
- Getting and setting CSS variables with JQuery in WordPress backend fails
- How to show address in one row?
- Custom CSS on mobile
- Set version number in child’s style.css file
- How to make a sidebar form show at the top of page on mobile?
- I want to transfer my additional css code to my theme file–?
- WordPress changing content:”” to content: "
- How to customize Metaboxes?
- Change image using only CSS [closed]
- Logo Keeps Changing to the Default for Transparent Settings
- Content going full width even though container is not
- Custom Plugin CSS: Can’t update them!
- Align divs in a basic WordPress site
- Altering the design of WooCommerce notifications [closed]
- How can I override an existing custom CSS rule for a specific page
- How can I add this specific link hover effect to a WP site? [closed]
- HTML5/CSS3 Polyfill for wp-login.php
- Bizarre WordPress CSS update problem
- Making a custom CSS per mobile
- Pages in another language
- Display current category without an active link in wp_list_categories
- Using a style sheet for modern browsers and another for older browsers
- WordPress with PageLines theme: how to change the background color of a page? [duplicate]
- How to add input search field with roudned corners?
- s2member captcha how to make responsive – css or javascript
- Min height of page [closed]
- How to define a special character to change the style of my inline code?
- Why is the “Additional CSS” section missing in my theme Customizer?
- Is there a way to edit the fonts of headings without a plugin (in the 2022 theme)?
- How to avoid problems caused by new block-library default CSS rules (wp 6.1.1)
- Grid problem on privew mode
- Disabling double vertical scrollbar and horizontal scrolling?
- Customize margin between paragraphs using the Gutenberg Style editor
- How to remove automatically added custom style tag?