Pull Random Images From Options Page [closed]

There’s nothing WordPress-specific about this, just some simple php: // generate an array of numbers $numbers = range( 1, 8 ); // shuffle the array in random order shuffle( $numbers ); // use the first 4 values from the randomized array of numbers echo eh_get_option( ‘eh_slide_image_’ . $numbers[0] ); echo eh_get_option( ‘eh_slide_image_’ . $numbers[1] ); … Read more

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

Creating your own options-general.php page

You don’t. You would have to keep your new page in sync with the core file each time WordPress is updated … that would not be very pragmatic. Hook into the do_settings_sections(‘general’); with register_setting() and add your code here. There is a third parameter for register_setting(): you can register a callback function here which used … Read more

How to display update message only to admin

Create your own plugin with this code or put this in theme’s functions.php add_action(‘init’, ‘remove_update_notification’, 1) function remove_update_notification() { if (!current_user_can(‘manage_network’)) { // checks to see if current user can update plugins add_action( ‘init’, create_function( ‘$a’, “remove_action( ‘init’, ‘wp_version_check’ );” ), 2 ); add_filter( ‘pre_option_update_core’, create_function( ‘$a’, “return null;” ) ); } }

How do I use update_option to give me a new option name each time a form is submitted? [duplicate]

To update a new option name each time you need something unique to be used as option name so may be using ‘time’ in the option name $now = new DateTime(); $mytime = $now->format(‘Y-m-d H:i:s’); // MySQL datetime format // $now->getTimestamp(); // Unix Timestamp $option[‘prefix-‘.$mytime] = ‘your value’; Then you can update as you wish. … Read more

The issue of redirecting my site to a new domain

There is a search and replace plugin I have used that works pretty good. http://wordpress.org/extend/plugins/search-and-replace/ In the future I would not hard code any links in if you can help it as well. Use dynamic linking like: $url = site_url(‘/secrets/’); echo $url; or: img src=”https://wordpress.stackexchange.com/questions/81722/<?php echo get_stylesheet_directory_uri() ?>/images/aternus.png” alt=”” title=”” width=”” height=”” /> as an … Read more

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’);