There’s no need to be using _e()
that’s for text that’s to be translated, you don’t translate CSS, it only comes in one language…
With regard to your if/else’ing, try this..
<?php
$options = get_option('mytheme_theme_options');
if( isset( $options['linkcolour'] ) && ( !empty( $options['linkcolour'] ) ) )
printf( "a, a:link {color: #%s;}", $options['linkcolour'] );
?>
Here’s some PHP references for helping understand the PHP that was used above.
http://www.php.net/manual/en/control-structures.if.php
http://php.net/manual/en/function.isset.php
http://www.php.net/manual/en/function.empty.php
http://php.net/manual/en/function.printf.php
Hope that helps.
Related Posts:
- Displaying theme options in css
- Theme Options Page – User Updates Logo
- Selectbox in admin panel function linking to CSS
- How to add drag and drop functionalities to a div inside option panel
- Using theme options to change a border-radius value
- How to change a specific character in a theme option value – replace a space with a plus sign
- Adding first / last CSS classes to menus
- WordPress Admin Bar pushed Sticky Footer off the bottom of the page
- Editor role cannot save custom theme options
- wp_customize_image_control default value
- Site Title and Tagline in Pagelines DMS Options Panel
- “wp_enqueue_style();” don’t load new edited style
- functions.php not adding css to website?
- if file_exists not working with wp_enqueue_style
- Using PHP to toggle stylesheet and header image, set in cookie
- Archive dropdown styling not applied
- Different background-image by category
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Put CSS inside a PHP file and include it the right way
- Putting PHP variables into javascript [duplicate]
- How Display Posts on category
- Slider loading issue
- Parent theme CSS overriding child CSS rules
- How to style options page in dashboard?
- Dynamic Stylesheet loads but doesn’t finish
- How to add date to navigation bar
- Incorrect MIME type for assets with Valet
- Customize position of social icons in upme plugin [closed]
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- proper way to add css using functions.php?
- Use PHP in stylesheet to specify a background image based on Category ID
- WordPress Options Page Theory Question
- RTL Stylesheet Confusion with WordPress
- WordPress wp_add_inline_style unable to give hex colors?
- How to make container class in PHP
- How to create table in wordpress without plugin? [closed]
- PHP in CSS file?
- Warning: Illegal string offset on theme options page [closed]
- Add class to DIV depending on page loaded
- Liking a facebook page from wordpress website?
- trouble with page_id & highlighting current page
- Last class on last headline?
- wordpress admin plugin menu custom css
- How to remove sidebar primary widget on Mobile on category page [closed]
- How to Change CSS Colors from Custom Plugin Settings Page
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Issue Enqueueing WordPress style.css
- Applying CSS on PHP variable [closed]
- Deactivate a plugin on wp version
- CSS images don’t show up with bloginfo
- how to changes mobile menu toggle breakpoint in WordPress
- Timber right sidebar in WordPress theme
- Illegal string offset in PHP function in via Theme Customizer
- How to Remove Theme Style CSS inside Custom Plugin?
- Add other class content with reference class value
- oceanwp+woo mobile cart sidebar text
- Adding Custom css file in the wp-uploads directory with custom php functions
- My top header looks different on single pages but is fine on the home page
- Using php code inside style tag
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- How to hide a div section when user is logged in, in single product woocommerce
- How do I integrate vanilla Javascript to a wordpress website?
- Can’t display anything through homepage text editor
- Cannot dequeue Elementor Font Awesome css
- How to find and delete a menu item in php?
- How to print all the inline styles in the WP_Styles instance together with their keys?
- WordPress Slider is not working
- How to display post meta bellow every posts
- How to let mobile navigation menu close when link is clicked?
- Add Shortcode to ::before class
- Site title not showing. Please help me
- Fix hover images blink
- Blog Image and Title in Right Sidebar
- Target a specific container to style on WordPress storefront theme
- Displaying POST content with HTML tags and all
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- Position a repeated article blocks
- Custom Thumbnails [closed]
- Custom Theme, Editor won’t wrap text (i.e. change width)
- Revision History for Entire WordPress Site
- wp_customize_image_control default value
- WordPress Setting page can not be saved by html radio
- wp add inline style in loop
- Display pages from specific page template
- How do I use CSS or PHP to customize WordPress Form Manager Plugin Table?
- Sidebar doesnt get updated?
- How to NOT override inline css rules
- Add CSS class to PHP Statement
- How to add margin underneath woocommerce total price amount -> productpages
- Select area and checkbox data is not saving?
- Load files content [closed]
- Load slideshow.css file only if Slideshow is checked / on
- Options.php loop won’t show!
- Predefine Magazine Style Layouts
- It’s not showing full content for posts pages in wordpress “[…]” while customing some changes in the style.css file [closed]
- Add a “Next Post” & “Previous Post” styled button manually to a post
- Sorting Problem
- hello can you advise how to fix the error?
- inner-wrap div pushing custom table far down on page
- Styling best practices for single pages/templates