Weird undefined index: id,std notices. How to fix it?
First: Write false === get_option( ‘whatever’ ); – see Coding Standards. Second: Why do you have a variable-variable in there? $$value[‘id’] = $value[‘std’];.
First: Write false === get_option( ‘whatever’ ); – see Coding Standards. Second: Why do you have a variable-variable in there? $$value[‘id’] = $value[‘std’];.
You have to include the theme_support in your functions.php Simply add this to your functions.php add_custom_background();
In the theme folder there is probably a folder called cache where timthumb stores the images it creates. Make sure this is writable, as otherwise timthumb can’t put it’s images anywhere and simply fails to load anything.
You can add a new ‘main’ page to the admin menu using add_menu_page (see Codex). The solution @Kaiser linked to provides sufficient detail on how to create a settings page. The only difference is that rather than adding a page under ‘Appearance’ (with add_options_page) you’ll want to use add_menu_page If this is for distribution I … Read more
As per my experience isset will not work for text, textarea it will work for checkbox, radio etc (may be someone can guide you in depth for this) To set option with dropdown selection I would prefer to use switch and case as below <?php switch (get_option(‘your_option_id’)) { case “Default”: ?> <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/54377/<?php bloginfo(“template_url’); … Read more
Try using add_submenu_page for adding a submenu for the extra entry. Once you add one submenu entry, by default you will have 2 subitems: the parent one (the same as the root item) and the new subitem. This is a default behavior from WordPress (replicating the parent element as the first row when you have … Read more
So checked is fairly simple to understand. It compares the first two values. If they’re equal, it spits out checked=”checked” if they aren’t equal nothing happens. <?php $saved = ‘on’; $compare=”on” // spits out checked=”checked” checked($saved, $compare); $saved = ‘off’; // does nothing checked($saved, $compare); How you save check boxes it up to you. Because … Read more
The options are saved as an array under a single key, what you see in the db is serialized data. WordPress takes care of unserializing the data when the option is loaded, so you can reference each individual option the same way you’d reference an element in any php array: $my_options = get_option(‘RWWA’); echo $my_options[‘colour’];
When you save an array of data in an option, WordPress serializes it to save, then when you use get_option, it gets unserialized back into the original array, so it can be accessed as you’d access any indexed array without keys in php: original option added: $hsv = array(‘hval’,’sval’,’vval’); add_option(‘hsv’, $hsv); then, to access this … Read more
When you redirect via wp_safe_redirect, this is done by sending a header to the browser containing the URL to redirect to. If any content has been sent to the browser before trying to send this header, you get the headers already sent error. Once content goes to the browser, happy header time is over, no … Read more