Testing for addon plugin activated

There is the function is_plugin_active() which can be used easily for this check, but what if the user decides to change the folder name of the plugin? Simply put, you’re doing it wrong. If you’re making extensions for a plugin, then you should provide hooks in the “parent” plugin for those addons to hook into … Read more

Stop Images Linking to Themselves?

To change the default for images (so you don’t have to choose “none” on the image links to checkboxes every time you insert an image into a post), you can go to yoursite.com/wp-admin/options.php; find the image_default_link_type option, and change the value from “file” to “none”.

How to create an option page for this simple plugin

Copy pate this below code in your functions.php file, <?php add_menu_page(‘BAW Plugin Settings’, ‘BAW Settings’, ‘administrator’, __FILE__, ‘baw_settings_page’, get_stylesheet_directory_uri(‘stylesheet_directory’).”/images/media-button-other.gif”); ?> <?php // create custom plugin settings menu add_action(‘admin_menu’, ‘baw_create_menu’); function baw_create_menu() { //create new top-level menu add_menu_page(‘BAW Plugin Settings’, ‘BAW Settings’, ‘administrator’, __FILE__, ‘baw_settings_page’,plugins_url(‘/images/icon.png’, __FILE__)); //call register settings function add_action( ‘admin_init’, ‘register_mysettings’ ); } function … Read more

How to display custom style based on theme option select box

Just put your dynamic CSS inside of a callback function, hooked into wp_print_script, e.g. function mytheme_custom_css() { ?> <script type=”text/css”> <?php if ( of_get_option(‘show_post_sidebar’, true ) ) { ?> .post{width:720px} <?php } ?> </script> <?php } add_action( ‘wp_print_scripts’, ‘mytheme_custom_css’ ); Add as few, or as many, conditional CSS rules as you need.

Woo Framework: woo_cat_featured not populating

So I fixed it by changing array( ‘taxonomy’ => ‘category’, ‘terms’ => array( $woo_options[ ‘woo_cat_featured’ ] ), ‘field’ => ‘ID’, ‘operator’ => ‘IN’ ), to array( ‘taxonomy’ => ‘category’, ‘terms’ => array( $woo_options[ ‘woo_cat_featured’ ] ), ‘field’ => ‘slug’, ‘operator’ => ‘IN’ ), Specifically: ‘field’ => ‘ID’, to ‘field’ => ‘slug’, . I’m not sure … Read more

API for wp menu hacks

There are several of plugins that ads that kind of functionality. They put a checkbox to the admin area, so if you uncheck it its not gonna appear in the menu. Here is a good one: http://wordpress.org/extend/plugins/exclude-pages/

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