WordPress theme options tabs

WordPress includes many js libraries in \wp-includes\js and in wp-admin\js. You can browse through them and choose which one you want, including jQuery tabs. You can use it in your theme by using this function, http://codex.wordpress.org/Function_Reference/wp_enqueue_script To figure out how to use the tabs, you would read about it here: http://jqueryui.com/demos/tabs/

Save Option on Database

<?php add_option( $option, $value, $deprecated, $autoload ); ?> http://codex.wordpress.org/Function_Reference/add_option global $options; ?> <form action=”options.php” method=”post”> <?php $settings = get_option(‘options’); ?> <?php settings_fields(‘theme_options’); ?> <fieldset> <legend>Counter Position:</legend> </br> <p> Right <input type=”radio” name=”position” value=”right”/> <p> Left <input type=”radio” name=”position” value=”left”/> <p> Center <input type=”radio” name=”position” value=”center”/> </fieldset> </form> <?php function r_set() { register_setting(‘theme_options’, ‘options’, ‘validate_options’); } … Read more

wordpress theme option in other templates

If you are using some custom global theme options, I’d set them in functions.php. Then you access them from any template if you declare them global first. // functions.php <?php $aagt_fb_url=”foo”; – // template file like header.php, index.php, etc. <?php global $aagt_fb_url; echo $aagt_fb_url;

Hiding an added admin page menu using css

WordPress already takes care of that for you. The third argument in your add_menu_page function, which reads edit_themes is the capability required to access the page. If the user doesn’t have that capability he can’t access the page, so WordPress won’t show him that option on the menu. Clever, no? Now, from the code you … Read more

using Ajax: call to undefined function get_option

Basically, if you’re going to be making calls to WordPress functions, then you should be in the WordPress environment, which means that you should not be calling your own files to begin with, but should implement your AJAX call within a WordPress hook. Read up on this: http://codex.wordpress.org/AJAX_in_Plugins That article describes how to implement AJAX … Read more

Best place to store company address

Create an Option Page and name it something like “Adress”. In Google you will find a lot about Option Pages. For this small Settings, i would not recommend to use a option-framework. Some Links: Nettuts or 12 how to’s.

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