Using if/else statements with output from theme options

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 …

Read more

WordPress custom options storing?

WordPress is built to import and export content. As such, there is no built-in way to import or export settings. Some theme and plugin authors, however, have built tools into their systems that import/export XML files that their systems can use store options. A great example is WordPress SEO by Yoast. Not only can you …

Read more

How Do I Use A Custom Mobile Theme?

This depends on the theme in question, Some themes have a desktop and mobile versions built in. Some themes are made to fit the screen size (responsive). Some themes (for mobile) come as a plugin which activates it self when the user access the site from a mobile device. So In the either way its …

Read more

Selectbox in admin panel function linking to CSS

Not Recommended <?php if(theme_get_option(‘theme_style_options’) == ‘style1’): ?> <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/55754/<?php echo get_template_directory_uri(); ?>/style1.css” /> <?php elseif(theme_get_option(‘theme_style_options’) == ‘style2’): ?> <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php echo get_template_directory_uri(); ?>/style2.css” /> <?php elseif(theme_get_option(‘theme_style_options’) == ‘style3’): ?> <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php echo get_template_directory_uri(); ?>/style3.css” /> <?php endif;?> OR <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/55754/<?php echo get_template_directory_uri(); ?>/<?php …

Read more