<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Welcome to Dhrusya Solutions &#187; blg</title>
	<atom:link href="http://demo.dhrusya.com/blg/feed/" rel="self" type="application/rss+xml" />
	<link>http://demo.dhrusya.com</link>
	<description>Web Development</description>
	<lastBuildDate>Mon, 29 Sep 2014 09:36:59 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>WordPress meta queries</title>
		<link>http://demo.dhrusya.com/wordpress-meta-queries/</link>
		<comments>http://demo.dhrusya.com/wordpress-meta-queries/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 10:05:34 +0000</pubDate>
		<dc:creator><![CDATA[wp-admin]]></dc:creator>
				<category><![CDATA[blg]]></category>

		<guid isPermaLink="false">http://demo.dhrusya.com/?p=617</guid>
		<description><![CDATA[If you want to get a post with meta key show_on_homepag [&#8230;]]]></description>
				<content:encoded><![CDATA[<h4>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:</h4>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_key' =&gt; 'show_on_homepage',
	'meta_value' =&gt; 'on'
);

$rd_query = new WP_Query($rd_args);
</pre>
<h4>If you need to query all posts except the ones with this pair of meta key and value, you can use the following parameters:</h4>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_key' =&gt; 'show_on_homepage',
	'meta_value' =&gt; 'on',
	'meta_compare' =&gt; '!='
);

$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Get Posts with a Specific Custom Field Value</h4>
<pre class="brush: php; title: ; notranslate">
// the meta_key 'color' with the meta_value 'white'
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'color',
			'value' =&gt; 'white'
		)
	)
); 
$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Get all the posts except the ones with meta key «color» and meta value «white»:</h4>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'color',
			'value' =&gt; 'white',
			'compare' =&gt; '!='
		)
	)
);

$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Get all the posts with white OR green color custom field value:</h4>
<pre class="brush: php; title: ; notranslate">
// custom field name is color and custom field value is 'white' OR 'green'
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'color',
			'value' =&gt; array('white','green'),
			'compare' =&gt; 'IN'
		)
	)
); 
$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Get all the posts (products in online shop for example) except white products and green products:</h4>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'color',
			'value' =&gt; array('white','green'),
			'compare' =&gt; 'NOT IN'
		)
	)
);
$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Get Posts Within a Given Range of Numeric Meta Values</h4>
<pre class="brush: php; title: ; notranslate">
// the product price is more than 2000 and less than 4000
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'price',
			'value' =&gt; array( 2000, 4000 ),
			'type' =&gt; 'numeric',
			'compare' =&gt; 'BETWEEN'
		)
	)
);
$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Numeric Comparison</h4>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'price',
			'value' =&gt; 2000,
			'type' =&gt; 'numeric',
			'compare' =&gt; '&gt;='
		)
	)
);
</pre>
<h5>The product price is less than 4000:</h5>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_query' =&gt; array(
		array(
			'key' =&gt; 'price',
			'value' =&gt; 4000,
			'type' =&gt; 'numeric',
			'compare' =&gt; '&lt;'
		)
	)
); 
$rd_query = new WP_Query( $rd_args );
</pre>
<h4>Query Posts by Several (two or more) Custom Field Values</h4>
<pre class="brush: php; title: ; notranslate">
$rd_args = array(
	'meta_query' =&gt; array(
		'relation' =&gt; 'AND',
		array(
			'key' =&gt; 'color',
			'value' =&gt; 'white'
		),
		array(
			'key' =&gt; 'price',
			'value' =&gt; array( 2000, 4000 ),
			'type' =&gt; 'numeric',
			'compare' =&gt; 'BETWEEN'
		)
	)
); 
$rd_query = new WP_Query( $rd_args );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://demo.dhrusya.com/wordpress-meta-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Hacks</title>
		<link>http://demo.dhrusya.com/wordpress-hacks/</link>
		<comments>http://demo.dhrusya.com/wordpress-hacks/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 10:04:42 +0000</pubDate>
		<dc:creator><![CDATA[wp-admin]]></dc:creator>
				<category><![CDATA[blg]]></category>

		<guid isPermaLink="false">http://demo.dhrusya.com/?p=615</guid>
		<description><![CDATA[Here are few wordpres hacks that are very usefull while [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Here are few wordpres hacks that are very usefull while developing wordpress plugins and themes.</p>
<h4>Hide wordpress adminbar</h4>
<pre class="brush: php; title: ; notranslate">add_action('init', 'remove_admin_bar');
function remove_admin_bar() {
if ( !current_user_can('administrator') &amp;&amp; !is_admin()) {
show_admin_bar(false);
}
}</pre>
<h4>Show user/author posts only in admin</h4>
<p>By default wordpress displays all posts for any user logged into wp-admin. The following code restricts the post list by displaying only his posts.</p>
<pre class="brush: php; title: ; notranslate">function wps_get_post_list_by_user($clauses) {
if (is_admin()) {
global $user_ID, $wpdb;
// $clauses['join'] = &quot;, wp_posts&quot;;

$clauses['where'] .= &quot; AND wp_posts.post_author = &quot;.$user_ID;

};
return $clauses;
};
if ( !current_user_can( 'edit_users' ) ) {
add_filter('posts_clauses', 'wps_get_post_list_by_user');
}</pre>
<h4>Remove unwanted admin menus</h4>
<pre class="brush: php; title: ; notranslate">function remove_admin_menu_items() {
$remove_menu_items = array(__('Links'), __('Dashboard'),  __('Media'), __('Links'), __('Appearance'), __('Tools'),  __('Settings'), __('Comments'), );
global $menu;
end ($menu);
while (prev($menu)){
$item = explode(' ',$menu[key($menu)][0]);
if(in_array($item[0] != NULL?$item[0]:&quot;&quot; , $remove_menu_items)){
unset($menu[key($menu)]);}
}
}

if(get_logged_user_role()!=&quot;administrator&quot;){
add_action('admin_menu', 'remove_admin_menu_items');
}</pre>
<h4>Set Post Expert Length</h4>
<pre class="brush: php; title: ; notranslate">function custom_excerpt_length( $length ) {
	return 100;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );</pre>
<h4>Hide Plugin Update Notifications</h4>
<p>just copy and paste that code in the .php file of the plugin</p>
<pre class="brush: php; title: ; notranslate">
add_filter('site_transient_update_plugins', 'dd_remove_update_nag');
function dd_remove_update_nag($value) {
 unset($value-&gt;response[ plugin_basename(__FILE__) ]);
 return $value;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://demo.dhrusya.com/wordpress-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Node.js</title>
		<link>http://demo.dhrusya.com/how-to-use-node-js/</link>
		<comments>http://demo.dhrusya.com/how-to-use-node-js/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 10:03:47 +0000</pubDate>
		<dc:creator><![CDATA[wp-admin]]></dc:creator>
				<category><![CDATA[blg]]></category>

		<guid isPermaLink="false">http://demo.dhrusya.com/?p=613</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://demo.dhrusya.com/how-to-use-node-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with TinyMCE</title>
		<link>http://demo.dhrusya.com/working-with-tinymce/</link>
		<comments>http://demo.dhrusya.com/working-with-tinymce/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 10:03:10 +0000</pubDate>
		<dc:creator><![CDATA[wp-admin]]></dc:creator>
				<category><![CDATA[blg]]></category>

		<guid isPermaLink="false">http://demo.dhrusya.com/?p=611</guid>
		<description><![CDATA[You can not enhance the drop down list formatselect. Bu [&#8230;]]]></description>
				<content:encoded><![CDATA[<div>
<p>You can not enhance the drop down list <code>formatselect</code>. But you can enhance with the hook <code>tiny_mce_before_init</code> the second drop down <code>styleselect</code>, there is hide in a default WordPress install. The <a href="http://www.tinymce.com/wiki.php/Configuration%3aformats" rel="nofollow">documentation</a> list all defaults and possibilities.</p>
<ul>
<li>inline – Name of the inline element to produce for example “span”. The current text selection will be wrapped in this inline element.</li>
<li>block – Name of the block element to produce for example “h1″. Existing block elements within the selection gets replaced with the new block element.</li>
<li>selector – CSS 3 selector pattern to find elements within the selection by. This can be used to apply classes to specific elements or complex things like odd rows in a table.</li>
<li>classes – Space separated list of classes to apply the the selected elements or the new inline/block element.</li>
<li>styles – Name/value object with CSS tyle items to apply such as color etc.</li>
<li>attributes – Name/value object with attributes to apply to the selected elements or the new inline/block element.</li>
<li>exact – Disables the merge similar styles feature when used. This is needed for some CSS inheritance issues such as text-decoration for underline/strikethough.</li>
<li>wrapper – State that tells that the current format is a container format for block elements. For example a div wrapper or blockquote.</li>
</ul>
<h2>The Style Button</h2>
<p>Note that, by default, the Style dropdown is hidden in WordPress. At first add the button for custom formats to a menu bar of TinyMCE, in example line 2 with hook <code>mce_buttons_2</code>.</p>
<blockquote>
<pre><code>add_filter( 'mce_buttons_2', 'fb_mce_editor_buttons' );
function fb_mce_editor_buttons( $buttons ) {

    array_unshift( $buttons, 'styleselect' );
    return $buttons;
}</code></pre>
</blockquote>
<h2>The Custom Styles</h2>
<p>Then enhance the drop down of this button. Aslo useful the enancement via additional value in the array, see the <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference/tiny_mce_before_init" rel="nofollow">codex</a> for this example.</p>
<blockquote>
<pre><code>/**
 * Add styles/classes to the "Styles" drop-down
 */ 
add_filter( 'tiny_mce_before_init', 'fb_mce_before_init' );

function fb_mce_before_init( $settings ) {

    $style_formats = array(
        array(
            'title' =&gt; 'Download Link',
            'selector' =&gt; 'a',
            'classes' =&gt; 'download'
            ),
        array(
            'title' =&gt; 'My Test',
            'selector' =&gt; 'p',
            'classes' =&gt; 'mytest',
        ),
        array(
            'title' =&gt; 'AlertBox',
            'block' =&gt; 'div',
            'classes' =&gt; 'alert_box',
            'wrapper' =&gt; true
        ),
        array(
            'title' =&gt; 'Red Uppercase Text',
            'inline' =&gt; 'span',
            'styles' =&gt; array(
                'color'         =&gt; 'red', // or hex value #ff0000
                'fontWeight'    =&gt; 'bold',
                'textTransform' =&gt; 'uppercase'
            )
        )
    );

    $settings['style_formats'] = json_encode( $style_formats );

    return $settings;

}</code></pre>
</blockquote>
<h2>Result</h2>
<p><img alt="enter image description here" src="http://i.stack.imgur.com/K9Rcg.png" /></p>
<h2>Enhanced Drop down menu</h2>
<p>You can also enhance the drop down with a tree menu. Create the var from the example source above with more structure in the array, like the follow source.</p>
<blockquote>
<pre><code>    $style_formats = array(
        array(
            'title' =&gt; 'Headers',
                'items' =&gt; array(
                array(
                    'title' =&gt; 'Header 1',
                    'format' =&gt; 'h1',
                    'icon' =&gt; 'bold'
                ),
                array(
                    'title' =&gt; 'Header 2',
                    'format' =&gt; 'h2',
                    'icon' =&gt; 'bold'
                )
            )
        ),
        array(
            'title' =&gt; 'Download Link',
            'selector' =&gt; 'a',
            'classes' =&gt; 'download'
        )
    );</code></pre>
</blockquote>
<p><img alt="enter image description here" src="http://i.stack.imgur.com/kbfaB.png" /></p>
<p>For more possibilities and parameters see the default values of the Style Format Drop down field (write in javascript). var defaultStyleFormats = [ {title: &#8216;Headers&#8217;, items: [ {title: &#8216;Header 1&#8242;, format: &#8216;h1&#8242;}, {title: &#8216;Header 2&#8242;, format: &#8216;h2&#8242;}, {title: &#8216;Header 3&#8242;, format: &#8216;h3&#8242;}, {title: &#8216;Header 4&#8242;, format: &#8216;h4&#8242;}, {title: &#8216;Header 5&#8242;, format: &#8216;h5&#8242;}, {title: &#8216;Header 6&#8242;, format: &#8216;h6&#8242;} ]},</p>
<blockquote>
<pre><code>            {title: 'Inline', items: [
                {title: 'Bold', icon: 'bold', format: 'bold'},
                {title: 'Italic', icon: 'italic', format: 'italic'},
                {title: 'Underline', icon: 'underline', format: 'underline'},
                {title: 'Strikethrough', icon: 'strikethrough', format: 'strikethrough'},
                {title: 'Superscript', icon: 'superscript', format: 'superscript'},
                {title: 'Subscript', icon: 'subscript', format: 'subscript'},
                {title: 'Code', icon: 'code', format: 'code'}
            ]},

            {title: 'Blocks', items: [
                {title: 'Paragraph', format: 'p'},
                {title: 'Blockquote', format: 'blockquote'},
                {title: 'Div', format: 'div'},
                {title: 'Pre', format: 'pre'}
            ]},

            {title: 'Alignment', items: [
                {title: 'Left', icon: 'alignleft', format: 'alignleft'},
                {title: 'Center', icon: 'aligncenter', format: 'aligncenter'},
                {title: 'Right', icon: 'alignright', format: 'alignright'},
                {title: 'Justify', icon: 'alignjustify', format: 'alignjustify'}
            ]}
        ];</code></pre>
</blockquote>
<h2>Add Custom Stylesheet to the editor</h2>
<p>Now is the last point, that you include the custom css for this formats, via hook <code>mce_css</code>.</p>
<blockquote>
<pre><code>/**
 * Apply styles to the visual editor
 */  
add_filter( 'mce_css', 'fb_mcekit_editor_style');
function fb_mcekit_editor_style($url) {

    if ( ! empty( $url ) )
        $url .= ',';

    // Retrieves the plugin directory URL
    // Change the path here if using different directories
    $url .= trailingslashit( plugin_dir_url( __FILE__ ) ) . '/my-editor-styles.css';

    return $url;
}</code></pre>
</blockquote>
<p>Don&#8217;t forget to add this stylesheet rules also to the front end stylesheet.</p>
<h2>Remove the Format Button</h2>
<p>As enhancement you can remove the <code>formatselect</code> drop down button via check for the value in the button array. Add the follow source to the function <code>fb_mce_editor_buttons</code> at the hook <code>mce_buttons_2</code>.</p>
<blockquote>
<pre><code>$value = array_search( 'formatselect', $buttons );
if ( FALSE !== $value ) {
    foreach ( $buttons as $key =&gt; $value ) {
        if ( 'formatselect' === $value )
            unset( $buttons[$key] );
    }
}</code></pre>
</blockquote>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://demo.dhrusya.com/working-with-tinymce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allow sub folders or subdomains inside magento website</title>
		<link>http://demo.dhrusya.com/allow-sub-folders-or-subdomains-inside-magento-website/</link>
		<comments>http://demo.dhrusya.com/allow-sub-folders-or-subdomains-inside-magento-website/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 10:02:09 +0000</pubDate>
		<dc:creator><![CDATA[wp-admin]]></dc:creator>
				<category><![CDATA[blg]]></category>

		<guid isPermaLink="false">http://demo.dhrusya.com/?p=609</guid>
		<description><![CDATA[To allow browsing sub folders or sub domains inside a m [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>To allow browsing sub folders or sub domains inside a magento installation add following code to .htaccess file under main magento site.</p>
<blockquote><p>
RewriteRule ^demo/ &#8211; [L,NC]</p></blockquote>
<p>before &#8220;RewriteEngine on&#8221; or &#8220;RewriteBase&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://demo.dhrusya.com/allow-sub-folders-or-subdomains-inside-magento-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show errors in joomla</title>
		<link>http://demo.dhrusya.com/show-errors-in-joomla/</link>
		<comments>http://demo.dhrusya.com/show-errors-in-joomla/#comments</comments>
		<pubDate>Tue, 09 Sep 2014 10:01:20 +0000</pubDate>
		<dc:creator><![CDATA[wp-admin]]></dc:creator>
				<category><![CDATA[blg]]></category>

		<guid isPermaLink="false">http://demo.dhrusya.com/?p=607</guid>
		<description><![CDATA[Sometimes we may be struck with some errors like white  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Sometimes we may be struck with some errors like white screen of death and other errors.<br />
Then to know what causing the error simplifies our problem. To enable errors on joomla website do the following.</p>
<p>Put the following code at the END of the configuration.php file BEFORE the closing ?></p>
<blockquote><p>
ini_set( &#8216;display_errors&#8217;, true );<br />
error_reporting( E_ALL );</p></blockquote>
<p>And also you can try following tips too,</p>
<p>1. Check server error logs (not access logs) if you have access to them. (cPanel or other control panels often allow this)<br />
2. Go to Joomla Administration → Global configuration and enable Error Reporting to Maximum, you can also turn on debugging.<br />
3. Check the source of the white page – there might be still some HTML/Errors in the Page Source (Look in your web browser for the “View Source” option)</p>
<p>Hope these helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://demo.dhrusya.com/show-errors-in-joomla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
