Blog
WordPress meta queries
If you want to get a post with meta key show_on_homepage and meta value on, you can do it in the following way: [php] $rd_args = array( ‘meta_key’ => ‘show_on_homepage’, ‘meta_value’ => ‘on’ ); $rd_query = new WP_Query($rd_args); [/php] If you need to query all posts except the ones with this pair of meta key and value, you can...
WordPress Hacks
Here are few wordpres hacks that are very usefull while developing wordpress plugins and themes. Hide wordpress adminbar [php]add_action(‘init’, ‘remove_admin_bar’); function remove_admin_bar() { if ( !current_user_can(‘administrator’) && !is_admin()) { show_admin_bar(false); } }[/php] Show user/author posts only in admin By default wordpress displays all posts for any user logged into wp-admin. The following code restricts the post list by displaying...
Working with TinyMCE
You can not enhance the drop down list formatselect. But you can enhance with the hook tiny_mce_before_init the second drop down styleselect, there is hide in a default WordPress install. The documentation list all defaults and possibilities. inline – Name of the inline element to produce for example “span”. The current text selection will be wrapped in this inline element. block – Name of the...
Allow sub folders or subdomains inside magento website
To allow browsing sub folders or sub domains inside a magento installation add following code to .htaccess file under main magento site. RewriteRule ^demo/ – [L,NC] before “RewriteEngine on” or...
Show errors in joomla
Sometimes we may be struck with some errors like white screen of death and other errors. Then to know what causing the error simplifies our problem. To enable errors on joomla website do the following. Put the following code at the END of the configuration.php file BEFORE the closing ?> ini_set( ‘display_errors’, true ); error_reporting( E_ALL ); And also...