Theme Options Page – Select, Radio, Tabs

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

Admin menus and submenus

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

How to use checked() function with multiple check box group? How to properly sanitize that checkbox group?

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

Options Framework not saving options correctly

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

How to get functions.php to talk to options.php

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

Cannot modify headers

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

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