I don’t have permission to save the theme options I created myself?

You’re adding the menu page using the “administrator” role. Is the account you’re using an administrator? Note: 1) You should be using an appropriate capability, rather than a user role. Generally, the appropriate capability for editing Theme options is edit_theme_options. 2) There is a known bug with WordPress, in that currently, manage_options is required for … Read more

Hiding Google Analytics code based on theme options

Take the GA code from your header and wrap it in a function hooked to wp_head; function __analytics_head() { $options = get_option( ‘themename_theme_options’ ); if ( !empty( $options[‘analytics’] ) ) : ?> <script type=”text/javascript”> var _gaq = _gaq || []; _gaq.push([‘_setAccount’, ‘<?php echo esc_js( $options[‘analytics’] ) ; ?>’]); _gaq.push([‘_trackPageview’]); (function() { var ga = document.createElement(‘script’); … Read more

Multiple Custom Headers

What you want to achieve is posible but not with WordPress custom-header feature because it’s you can use multiple images in random sequence. If you mean ‘different page templates’ you can simply hard code your images links in your templates, but this is not good solution. Another solution is to write function which will check … Read more

Setting field not saving on front-end

Make the $options variable global by changing the header_add_content() function to the following: function header_add_content() { global $options; $options = get_option(‘header_options’); } add_filter(“the_content”, “header_add_content”); Then declare $options as the global $options on the front-end template before you use it, for example: <p><?php global $options; echo $options[‘txt_mail’]; ?></p>

How can I style my theme admin page?

In your construct function you also need to enqueue a custom stylesheet that will house the CSS to style up your theme options. A simplified example would look like this: function admin_style() { wp_enqueue_style( ‘theme-options-style’, get_template_directory_uri().’styles/theme-options-style.css’); } add_action(‘admin_enqueue_scripts’, ‘admin_style’);

send information from the thickbox image uploader second tab

So i decided that for me, i can settle for changing an input field on the top.parent for it to be used with the native options. i used this for the function of the iframe tab: function media_upload_choosebackground_form() { media_upload_header(); ?> <h3 class=”media-title”>HTML Form</h3> <img src=”http://www.mimi.me/wp-content/themes/mimi.me_regular_sites/images/background-Green-stripes-thumb.jpg” style=”cursor:pointer; float:left; margin:10px 0 0 10px” id=”greenstripes” title=”Green Stripes” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)