I understand what you are trying to do, but you are going in the wrong direction here, you can just check if one was selected in your logic and assign the value there like this:
function css_customizer(){
$blog_setting_val = get_theme_mod('blog_setting');
$opacity_val = ($blog_setting_val == 'block') ? '1' : '0';
?>
<style type="text/css">
.blog__Link{display: <?php echo $blog_setting_val; ?>}
.second_css_class{opacity: <?php echo $opacity_val; ?>}
</style>
<?php
}
add_action('wp_head', 'css_customizer');
that should do it for your particular case.
Related Posts:
- How to extend nav-menu-item-control data in Appearance > Customize?
- How to change popular term checklist title when edit post?
- Is it possible to add custom badges to product attributes conditionally, based on custom field?
- WordPress Responsive Custom Control WP Customizer
- How to remove admin menu pages inserted by plugins?
- New WP_Customize API – how does it work under the hood?
- Making Custom Fields Standard in the Admin UI
- Disable Visible Edit Shortcuts in the Customizer
- How to Add Customizer Setting in Child Theme
- Custom ReCaptcha Login
- Creating my own Admin Forms in a WordPress CMS?
- How to make custom bulk actions work on the media/upload page?
- Removing fields from the Media Uploader/Gallery
- deleted users still show in count?
- How to add checkbox and radio button in Profile Page
- customize_register with Multiple controls/settings – how to get values?
- How to remove Profile Picture section or the message “You can change your profile picture on Gravatar.”
- Manipulating post meta in the customizer
- Widgets not working in Customizr but working in Appearance
- How to build custom WP admin with custom URLs
- In the new Theme Customizer API, how to send a value from the front back to the admin panel?
- get_theme_mod(); returns nothing
- Add field to posts (checkbox) that only one post can have
- generate unique number when registering a user
- Redirect members to custom page upon logging in through WP admin
- How to insert a writing panel between the title and the page content?
- How to add css option to Header Image customizer?
- Toggle custom fields?
- Customizing Users in Admin Area
- Custom Columns WordPress Admin
- Restrict Viewing of post on both front and backend?
- How to print Array values of custom Fields Meta?
- Get users based on month ACF datepicker field
- What is the best way to modify Admin Panel on WordPress?
- add custom content to appearance/widgets screen
- how to make a custom field readonly or disabled by user role?
- Trigger Customizer Publish (save) Action
- How to edit alternate inactive themes in “Appearance -> Customise” screen?
- Is it necessary to prefix theme_mod, section id and panel id in the customizer?
- Hide Customizer’s Widget Choices From The List
- How to remove Customizer’s Section and move Control straight to Panel using Child Theme
- Remove Customizer Control Choices (Type: Radio Array) using Child Themes
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- Let author add field to metabox by pressing a button
- Dynamic Control in customiser
- How to auto add nofollow to links in custom field?
- Is it possible to rename a customizer control heading?
- Customizing admin look and feel for just one particular type of user
- Make separate text boxes for separate WordPress Custom Fields
- Open login logo URL in new tab
- Change admin_title of a plugin using code snippet/functions
- How to get Previous Visited Page Information
- Will WordPress updates remove Gutenberg Additional Classes?
- WordPress category custom title
- No plugin populate user information in to form
- Easily add custom HTML outside the main container?
- How can Use custom input field in functions.php page?
- Simple custom attributes on posts
- Use a custom page with dynamic content as a user profile page
- Delete a column in edit.php generated with a plugin
- Customizer options limited to specific user roles?
- Add admin page for specific post status (for example)
- Query Product categories what have a custom field
- Can’t Customize WordPress Page
- How to show Term ID beside Name Category with wp_dropdown_categories()
- How to create custom backend admin menu in different languages?
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- POST 429 Error when trying to place more than 20 images into post at once
- Figuring out how to create “Option Pages” in WordPress admin
- WordPress Customizer: Check for value of CSS selector and replace it
- Replace publish date in blog module with custom field
- Check get_post value after wp-admin login
- Custom Admin Section
- where can i find the login page in wordpress and add my header to it
- In wordpress customizer api adding div wrap to control
- How do I enable the text editer in my WordPress theme? [closed]
- Style Radio Buttons inside Edit Page (Custom Fields)
- How to add H1 Tag on Homepage?
- Add commentmeta custom field to every published comment with SQL
- Does WordPress support template resources/custom fields
- Change default “Apply Changes To” radio option when editing images
- Change post template the proper way
- Changing a setting in the wp-admin/customize.php reverts CSS styles to parent theme [closed]
- Extend WP_Customize_Control with Multiple Field Control
- Create Custom Admin Fields
- Apply `the_content’ filter to theme customisation live preview
- retrieve theme custom settings
- How to create functions that affect only a specific user
- Multiple Customizers
- Which IDE best for WordPress Development? [closed]
- Refresh Customize Section (not preview)
- Do i need to use PHP in customizer api?
- Prevent posts from being published if the ‘Uncategorized’-category or no category is selected
- Save And Display Mp3 Audio files on WooCommerce product page with Dokan
- Advice how to connect custom database with WordPress, change data in WordPress and finaly use this data
- Where did I put this one line of css?
- Add custom information in editor summary
- Import bootstrap 5 and bootstrap icons in wp-admin backend
- Customise “Add a New Post” page
- Hover Hide-Visible Additional CSS not working in WordPress website, but shows properly in Customize window