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?
- Making Custom Fields Standard in the Admin UI
- Disable Visible Edit Shortcuts in the Customizer
- Custom ReCaptcha Login
- Creating my own Admin Forms in a WordPress CMS?
- 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?
- 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?
- 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 get input_attrs in the sanitize function?
- How to change in customizer the “site identity” tab required capabilities
- How to get value from custom backend menu
- Allow Users to Set Password During Registration
- Custom protected password page with ACF
- Custom Dashboard Home Screen Options
- Add a page that appears in the backend admin that lists files to download? WP 3.3
- Adding “Interesting Tags” & “Ignored Tags” like StackOverflow.com in a WordPress Blog?
- Add new Control to Customizer to modify Headings (h1, h2, h3…) Color
- How do I change the default admin color scheme in MP6
- Passing page url into a custom field via the Press-This bookmarklet
- Custom column sorting in WordPress admin post table
- What will happen to the additional CSS when the theme is updated?
- Customizer field value into functions.php variable
- Convert an theme options page to use in customize.php also?
- Extend Screen Options
- Add more then one site logo – custom-logo theme support
- Hide devices selection from customizer?
- Fatal error in wp-admin/customize.php after fresh install due to null $wp_customize
- Can not sanitize select control in customize api
- Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date
- Allow non-admins to access the Customize theme page
- Create custom fields as image uploads [duplicate]
- Add a date updated/date modified option using custom fields
- How to add textarea field to taxonomy (tag)?
- How to add an extra button on woocommerce shop page and use it to send the product info with image in a mail? [closed]
- Woocomerce custom billing address fields display in order details [closed]
- Bind JS event to WordPress control customizer
- Save & Publish disabled for two dimensional array Customizer
- How to use default WP form elements to interact with custom DB table?
- What requirements for ACF custom fields key and name properties?
- Extend WordPress Core Classes in OOP Theme?
- Toggle custom fields?
- Custom Columns WordPress Admin
- 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
- 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
- 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
- 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?
- Use a custom page with dynamic content as a user profile page
- Customizer options limited to specific user roles?
- Add admin page for specific post status (for example)
- Query Product categories what have a custom field
- 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
- Custom Admin Section
- 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
- Create Custom Admin Fields
- Apply `the_content’ filter to theme customisation live preview
- retrieve theme custom settings
- 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
- Where did I put this one line of css?
- Add custom information in editor summary