Link theme options page using ACF to styles
Link theme options page using ACF to styles
Link theme options page using ACF to styles
You should be posting your data (via <form action=”” …> to your theme options page, rather than to the wp-admin/options.php file. The latter is for the stuff under Settings. Also, I don’t mean to be tossing dirt at anyone in particular, but always take the tips that you read on the web with a grain … Read more
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
Your looking for custom meta fields, which you can style anyway you want using CSS. http://codex.wordpress.org/Custom_Fields You would either have to write your own functions to accomplish this or use one of the many custom fields plugins, I would recommend the WPAlchemy MetaBox.
Its built in that way so you can have themes only on specific blogs: Disable the theme under Super Admin -> Themes. Enable the theme for one site under Super Admin -> Edit the site you want. Look on the top right, there’s a list of disabled themes.
Option values are longtext. So you can store up to 4,294,967,295 or 4GB (232 – 1) bytes in an option value. I wouldn’t do that … but feel free to test the edge cases. 🙂
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
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
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
You do not need to use check_admin_referer. If you are using the Settings API then WordPress handles nonce checking and saving data to the database. In terms of data validation, the only thing you need to provide is a validation callback. This callback receives all inputs with name specified in the second argument of register_setting … Read more