<?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>Let&#039;s start again... &#187; wordpress</title> <atom:link href="http://manchumahara.com/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://manchumahara.com</link> <description>&#34;Manchumahara&#34; ...... The virtual, crazy, vagabond and  an emotional stupid!</description> <lastBuildDate>Thu, 02 Feb 2012 13:47:24 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress</title><link>http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/</link> <comments>http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/#comments</comments> <pubDate>Fri, 21 Oct 2011 10:17:22 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://manchumahara.com/?p=694</guid> <description><![CDATA[I think the post title &#8220;Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress&#8221; says all what I want to say. I was just thinking to make admin like category or term widget to use on front end &#8230; <a href="http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><img src="http://manchumahara.com/wp-content/uploads/2011/10/hirarchycalcategory.png" alt="" title="hirarchycalcategory" width="230" height="286" class="alignleft size-full wp-image-695" /><br /> I think the post title &#8220;Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress&#8221;  says all what I want to say. I was just thinking to make admin like category or term widget to use on front end or theme or other places. So I took the code from wordpress core and used it. So here I am sharing the code with all.<br /> <span id="more-694"></span></p><h4>Select and Radio functions and classess:</h4><p>Select:</p><pre class="brush: php; title: ; notranslate">
&lt;?php
//
// Category Checklists
//

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 */
if(!class_exists('Walker_Category_Checklist')){
class Walker_Category_Checklist extends Walker {
	var $tree_type = 'category';
	var $db_fields = array ('parent' =&gt; 'parent', 'id' =&gt; 'term_id'); //TODO: decouple this

	function start_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;ul class='children'&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function end_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;/ul&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function start_el(&amp;$output, $category, $depth, $args) {
		extract($args);
		if ( empty($taxonomy) )
			$taxonomy = 'category';

		if ( $taxonomy == 'category' )
			$name = 'post_category';
		else
                        $name = $taxonomy;
			//$name = 'tax_input['.$taxonomy.']';

		$class = in_array( $category-&gt;term_id, $popular_cats ) ? ' class=&quot;popular-category&quot;' : '';
		//$output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                $output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                //$output .= '&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot; class=&quot;customcheckbox&quot; name=&quot;'.$name.'[]&quot; '.checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ).' value=&quot;'.$category-&gt;term_id.'&quot; /&gt; '.esc_html( apply_filters('the_category', $category-&gt;name )).'&lt;/label&gt;';
                //'&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot; class=&quot;customcheckbox&quot; name=&quot;language[]&quot; '.$check.' value=&quot;'.$language_list-&gt;cat_ID.'&quot; /&gt; '.$language_list-&gt;cat_name.'&lt;/label&gt;';
	}

	function end_el(&amp;$output, $category, $depth, $args) {
		$output .= &quot;&lt;/li&gt;\n&quot;;
                //$output .= &quot;\n&quot;;
	}
}
}
/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 *
 * @param unknown_type $post_id
 * @param unknown_type $descendants_and_self
 * @param unknown_type $selected_cats
 * @param unknown_type $popular_cats
 */
if(!function_exists('wp_category_checklist')){
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
	wp_terms_checklist($post_id,
	 	array(
			'taxonomy' =&gt; 'category',
			'descendants_and_self' =&gt; $descendants_and_self,
			'selected_cats' =&gt; $selected_cats,
			'popular_cats' =&gt; $popular_cats,
			'walker' =&gt; $walker,
			'checked_ontop' =&gt; $checked_ontop
  ));
}
}
/**
 * Taxonomy independent version of wp_category_checklist
 *
 * @since 3.0.0
 *
 * @param int $post_id
 * @param array $args
 */
if(!function_exists('wp_terms_checklist')){
function wp_terms_checklist($post_id = 0, $args = array()) {
 	$defaults = array(
		'descendants_and_self' =&gt; 0,
		'selected_cats' =&gt; false,
		'popular_cats' =&gt; false,
		'walker' =&gt; null,
		'taxonomy' =&gt; 'category',
		'checked_ontop' =&gt; false
	);
	extract( wp_parse_args($args, $defaults), EXTR_SKIP );

	if ( empty($walker) || !is_a($walker, 'Walker') )
		$walker = new Walker_Category_Checklist;

	$descendants_and_self = (int) $descendants_and_self;

	$args = array('taxonomy' =&gt; $taxonomy);

	$tax = get_taxonomy($taxonomy);
	$args['disabled'] = !current_user_can($tax-&gt;cap-&gt;assign_terms);

	if ( is_array( $selected_cats ) )
		$args['selected_cats'] = $selected_cats;
	elseif ( $post_id )
		$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' =&gt; 'ids')));
	else
		$args['selected_cats'] = array();

	if ( is_array( $popular_cats ) )
		$args['popular_cats'] = $popular_cats;
	else
		$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' =&gt; 'ids', 'orderby' =&gt; 'count', 'order' =&gt; 'DESC', 'number' =&gt; 10, 'hierarchical' =&gt; false ) );

	if ( $descendants_and_self ) {
		$categories = (array) get_terms($taxonomy, array( 'child_of' =&gt; $descendants_and_self, 'hierarchical' =&gt; 0, 'hide_empty' =&gt; 0 ) );
		$self = get_term( $descendants_and_self, $taxonomy );
		array_unshift( $categories, $self );
	} else {
		$categories = (array) get_terms($taxonomy, array('get' =&gt; 'all'));
	}

	if ( $checked_ontop ) {
		// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
		$checked_categories = array();
		$keys = array_keys( $categories );

		foreach( $keys as $k ) {
			if ( in_array( $categories[$k]-&gt;term_id, $args['selected_cats'] ) ) {
				$checked_categories[] = $categories[$k];
				unset( $categories[$k] );
			}
		}

		// Put checked cats on top
		echo call_user_func_array(array(&amp;$walker, 'walk'), array($checked_categories, 0, $args));
	}
	// Then the rest of them
	echo call_user_func_array(array(&amp;$walker, 'walk'), array($categories, 0, $args));
}
}
?&gt;
</pre><p>Radio:</p><pre class="brush: php; title: ; notranslate">
&lt;?php
//
// Category Checklists
//

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 */
if(!class_exists('Walker_Category_Radiolist')){
class Walker_Category_Radiolist extends Walker {
	var $tree_type = 'category';
	var $db_fields = array ('parent' =&gt; 'parent', 'id' =&gt; 'term_id'); //TODO: decouple this

	function start_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;ul class='children'&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function end_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;/ul&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function start_el(&amp;$output, $category, $depth, $args) {
		extract($args);
		if ( empty($taxonomy) )
			$taxonomy = 'category';

		if ( $taxonomy == 'category' )
			$name = 'post_category';
		else
                        $name = $taxonomy;
			//$name = 'tax_input['.$taxonomy.']';

		$class = in_array( $category-&gt;term_id, $popular_cats ) ? ' class=&quot;popular-category&quot;' : '';
		//$output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                $output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;radio&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                //$output .= '&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot; class=&quot;customcheckbox&quot; name=&quot;'.$name.'[]&quot; '.checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ).' value=&quot;'.$category-&gt;term_id.'&quot; /&gt; '.esc_html( apply_filters('the_category', $category-&gt;name )).'&lt;/label&gt;';
                //'&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot; class=&quot;customcheckbox&quot; name=&quot;language[]&quot; '.$check.' value=&quot;'.$language_list-&gt;cat_ID.'&quot; /&gt; '.$language_list-&gt;cat_name.'&lt;/label&gt;';
	}

	function end_el(&amp;$output, $category, $depth, $args) {
		$output .= &quot;&lt;/li&gt;\n&quot;;
                //$output .= &quot;\n&quot;;
	}
}
}
/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 *
 * @param unknown_type $post_id
 * @param unknown_type $descendants_and_self
 * @param unknown_type $selected_cats
 * @param unknown_type $popular_cats
 */
if(!function_exists('wp_category_radiolist')){
function wp_category_radiolist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
        wp_terms_radiolist($post_id,
            array(
                    'taxonomy' =&gt; 'category',
                    'descendants_and_self' =&gt; $descendants_and_self,
                    'selected_cats' =&gt; $selected_cats,
                    'popular_cats' =&gt; $popular_cats,
                    'walker' =&gt; $walker,
                    'checked_ontop' =&gt; $checked_ontop
        ));
    }
}
/**
 * Taxonomy independent version of wp_category_checklist
 *
 * @since 3.0.0
 *
 * @param int $post_id
 * @param array $args
 */
if(!function_exists('wp_terms_radiolist')){
function wp_terms_radiolist($post_id = 0, $args = array()) {
 	$defaults = array(
		'descendants_and_self' =&gt; 0,
		'selected_cats' =&gt; false,
		'popular_cats' =&gt; false,
		'walker' =&gt; null,
		'taxonomy' =&gt; 'category',
		'checked_ontop' =&gt; false
	);
	extract( wp_parse_args($args, $defaults), EXTR_SKIP );

	if ( empty($walker) || !is_a($walker, 'Walker') )
		$walker = new Walker_Category_Radiolist;

	$descendants_and_self = (int) $descendants_and_self;

	$args = array('taxonomy' =&gt; $taxonomy);

	$tax = get_taxonomy($taxonomy);
	$args['disabled'] = !current_user_can($tax-&gt;cap-&gt;assign_terms);

	if ( is_array( $selected_cats ) )
		$args['selected_cats'] = $selected_cats;
	elseif ( $post_id )
		$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' =&gt; 'ids')));
	else
		$args['selected_cats'] = array();

	if ( is_array( $popular_cats ) )
		$args['popular_cats'] = $popular_cats;
	else
		$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' =&gt; 'ids', 'orderby' =&gt; 'count', 'order' =&gt; 'DESC', 'number' =&gt; 10, 'hierarchical' =&gt; false ) );

	if ( $descendants_and_self ) {
		$categories = (array) get_terms($taxonomy, array( 'child_of' =&gt; $descendants_and_self, 'hierarchical' =&gt; 0, 'hide_empty' =&gt; 0 ) );
		$self = get_term( $descendants_and_self, $taxonomy );
		array_unshift( $categories, $self );
	} else {
		$categories = (array) get_terms($taxonomy, array('get' =&gt; 'all'));
	}

	if ( $checked_ontop ) {
		// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
		$checked_categories = array();
		$keys = array_keys( $categories );

		foreach( $keys as $k ) {
			if ( in_array( $categories[$k]-&gt;term_id, $args['selected_cats'] ) ) {
				$checked_categories[] = $categories[$k];
				unset( $categories[$k] );
			}
		}

		// Put checked cats on top
		echo call_user_func_array(array(&amp;$walker, 'walk'), array($checked_categories, 0, $args));
	}
	// Then the rest of them
	echo call_user_func_array(array(&amp;$walker, 'walk'), array($categories, 0, $args));
}
}
?&gt;
</pre><h4>Usages:</h4><pre class="brush: php; title: ; notranslate">
&lt;ul class=&quot;nonbulletlist&quot;&gt;
                         &lt;?php
                            wp_terms_radiolist($postid, array( 'taxonomy' =&gt; 'category') );
                          ?&gt;
                    &lt;/ul&gt;
</pre><p>In the above code $poistid  is id of any wordpress post, if for new post it can be zero.  here I used category as taxonomy but tag or any custom taxonomy can be used.  I think this will helpfull for front end post submission form or helper code for plugin/themes.</p><p>thanks</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>আসুন ওয়ার্ডপ্রেসের ড্যাশ বোর্ড পরিস্কার করি</title><link>http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/</link> <comments>http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/#comments</comments> <pubDate>Thu, 26 May 2011 13:23:01 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Bangla Blogs]]></category> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[Wordpress Themes]]></category><guid isPermaLink="false">http://manchumahara.com/?p=677</guid> <description><![CDATA[ওয়ার্ডপ্রেসের এডমিন প্যানেলে লগিন করলেই একগাদা বক্স এসে হাজির হয়। যদিও স্ক্রিন অপশন থেকে সেগুলো সহজে তাড়ানো যায় কিন্তু যদি এমন হয় এডমিন নিজেই ড্যাশবোর্ড পরিস্কার করে রেখে দিলেন নতুন সদস্যের জন্য। তবে এই পরিস্কার এর কাজটা আমরা করবো সামান্য &#8230; <a href="http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>ওয়ার্ডপ্রেসের এডমিন প্যানেলে লগিন করলেই একগাদা বক্স এসে হাজির হয়। যদিও স্ক্রিন অপশন থেকে সেগুলো সহজে তাড়ানো যায় কিন্তু যদি এমন হয় এডমিন নিজেই ড্যাশবোর্ড পরিস্কার করে রেখে দিলেন নতুন সদস্যের জন্য। তবে এই পরিস্কার এর কাজটা আমরা করবো সামান্য কিছু পিএইচপি কোডিং করে।</p><p>ধাপ একঃ প্রথমে আপনার থীমের functions.php ফাইলে এ ২টি ফাংশন লিখতে হবে। মনে রাখবেন প্লাগিন এর কোডগুলো চাইলে functions.php ফাইলেও লেখা যায়। তাহলে শুরু করা যাকঃ</p><pre class="brush: php; title: ; notranslate">
    //Define the function which unsets the boxes
    function remove_dashboard_widgets() {
            global $wp_meta_boxes;
            myprint_r($wp_meta_boxes);
            /*
            //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
            # Remove plugins feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_plugins']);
            # Remove &quot;WordPress News&quot;
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_secondary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
            # Remove incoming links feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_incoming_links']);

            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['events_dashboard_window']);
           */
    }
    // Now hook in to the action
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets', 20, 0);

    //better print_r function taken from
    //http://stackoverflow.com/questions/1386331/php-print-r-nice-table
    function myprint_r($my_array) {
        if (is_array($my_array)) {
            echo &quot;&lt;table border=1 cellspacing=0 cellpadding=3 width=100%&gt;&quot;;
            echo '&lt;tr&gt;&lt;td colspan=2 style=&quot;background-color:#333333;&quot;&gt;&lt;strong&gt;&lt;font color=white&gt;ARRAY&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
            foreach ($my_array as $k =&gt; $v) {
                    echo '&lt;tr&gt;&lt;td valign=&quot;top&quot; style=&quot;width:40px;background-color:#F0F0F0;&quot;&gt;';
                    echo '&lt;strong&gt;' . $k . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&quot;;
                    myprint_r($v);
                    echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
            }
            echo &quot;&lt;/table&gt;&quot;;
            return;
        }
        echo $my_array;
    }
</pre><p><span id="more-677"></span><br /> ড্যাসবোর্ড এর বক্স বা উইডগেট গুলো একটা গ্লোবাল ভেরিয়েবল $wp_meta_boxes (টাইপ এরে) এ থাকে । এটা একটা মাল্টিডাইমেনশনাল এরে। যদি উপরের কোডটা লিখে ওয়ার্ডপ্রেসের এডমিন প্যানেলে প্রবেশ করেন তাহলে <a href="http://www.webpagescreenshot.info/img/259669-525201150932PM">এই ছবির</a> মতো দেখতে পারবেন।</p><p>দুইঃ এখন আমরা এটা দেখে দেখে বক্স বা উইডগেট গুলো বন্ধ করবো<br /> এখন আমরা remove_dashboard_widgets ফাংশনের কমেন্ট করা অংশ এক্টিভ করবো এবং দরকারে myprint_r($wp_meta_boxes); লাইনটা কমেন্ট করে দেবো।</p><pre class="brush: php; title: ; notranslate">
    //Define the function which unsets the boxes
    function remove_dashboard_widgets() {
            global $wp_meta_boxes;
            //myprint_r($wp_meta_boxes);
            //var_dump('&lt;pre&gt;'.$wp_meta_boxes.'&lt;/pre&gt;');

            //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
            # Remove plugins feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_plugins']);
            # Remove &quot;WordPress News&quot;
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_secondary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
            # Remove incoming links feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_incoming_links']);

            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
            //unset($wp_meta_boxes['dashboard']['normal']['core']['events_dashboard_window']);

    }
</pre><p>তিনঃ অনেক সময় নতুন প্লাগিন ড্যাশবোর্ড এ নতুন বক্স যুক্ত করে যা আমরা ধাপ এক এর মতো দেখে দেখে বন্ধ করে দিতে পারি। তবে এই কাজের জন্য দরকার হবে সামান্য পিএইচপি জ্ঞান <img src='http://manchumahara.com/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /></p><p>চারঃ<br /> ভাবছি একটা প্লাগিন নামিয়ে ফেলবো যেখান থেকে কি কি বক্স আছে তা ইচ্ছা মতো বন্ধ করা যাবে আবার দরকার এক্টিভেট করে দেওয়া যাবে।<br /> কেউ চাইলে আমার সাথে এই প্লাগিন এর কাজে অংশ নিতে পারেন। আমি আইডিয়া এবং কোড স্যাম্পেল দিয়ে দেবো শুরু করার জন্য এবং আপনাকে বাদ বাকী কাজটা সারতে হবে।</p><p>লেখাটি <a target="_blank" href="http://forum.amaderprojukti.com/viewtopic.php?f=60&#038;t=6629&#038;p=52949#p52949">আমাদের প্রযুক্তি ফোরামে</a> পূর্বে প্রকাশিত।</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Show/Hide comment status text in wordpress</title><link>http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/</link> <comments>http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/#comments</comments> <pubDate>Tue, 29 Mar 2011 04:48:47 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://manchumahara.com/?p=665</guid> <description><![CDATA[I am again confused if my post title is perfect or not So let me explain, sometimes we disable comment for any post or page and at last the text shows &#8220;Comments are closed&#8221; or something else in different ways. &#8230; <a href="http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I am again confused if my post title is perfect or not <img src='http://manchumahara.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> So let me explain, sometimes we disable comment for any post or page and at last the text shows &#8220;Comments are closed&#8221;  or something else in different ways. But in commercial projects we need to follow some good design where in some posts or pages we may need to enable comment or not. So, let&#8217;s put a trick in theme to show the comment text(comment status in more smart way)</p><p>In latest wordpress version the loop is in the loop.php file in the theme folder. So for comment we will get this line</p><pre class="brush: php; title: ; notranslate">
&lt;?php comments_template( '', true ); ?
</pre><p>But how about we put</p><pre class="brush: php; title: ; notranslate">
&lt;?php if($post-&gt;comment_status == &quot;open&quot;){comments_template( '', true );} ?&gt;
</pre><p>That means if comment is off then we will not show any text like &#8220;Comments are closed&#8221; . I strongly believe this trick will make the design clean in some condition <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p>Thank you</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>CSS3 Dropdown menu for wordpress default theme</title><link>http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/</link> <comments>http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/#comments</comments> <pubDate>Mon, 28 Mar 2011 10:05:14 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[css]]></category><guid isPermaLink="false">http://manchumahara.com/?p=660</guid> <description><![CDATA[At first look at the demo of a pure css3 dropdownload menu. For more details see the main post link here. I was thinking to make the default wordpress drop down menu like this and I just tried and did &#8230; <a href="http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>At first look at the demo of a <a rel="nofollow external" href="http://www.webdesignerwall.com/demo/css3-dropdown-menu/css-gradient-dropdown.html" target="_blank">pure css3 dropdownload menu</a>. For more details see the main post link <a rel="nofollow external" href="http://webdesignerwall.com/tutorials/css3-dropdown-menu" target="_blank">here</a>.<br /> <img class="aligncenter size-full wp-image-661" title="css3dropdownloadmenu" src="http://manchumahara.com/wp-content/uploads/2011/03/css3dropdownloadmenu.png" alt="" width="629" height="186" /><br /> <span id="more-660"></span><br /> I was thinking to make the default wordpress drop down menu like this and I just tried and did this. Though you may need little adjustment if you use this with any custom theme. Also I added the dropdown menu with my custom theme used in <a rel="follow internal" href="http://idea52.com" target="_blank">idea52.com</a>. See my output</p> <img class="size-full wp-image-662" title="css3dropdownloadmenu2" src="http://manchumahara.com/wp-content/uploads/2011/03/css3dropdownloadmenu2.png" alt="" width="865" height="321" /><p>So let&#8217;s make the default top dropdown menu like above. We need to play with our default theme stylesheet style.css. Open file style.css file from theme twentyten and find the line</p><pre class="brush: css; title: ; notranslate">
/* =Menu
-------------------------------------------------------------- */
</pre><p>And find code like</p><pre class="brush: css; title: ; notranslate">
/* =Content
-------------------------------------------------------------- */
</pre><p>We need remove code or replace all css code between those two line and paste with the following code.</p><pre class="brush: css; title: ; notranslate">
#access {
	/*background: #000;*/
	display: block;
	float: left;
	margin: 0 auto;
	width: 940px;
}
#access .menu-header,
div.menu {
	font-size: 13px;
	margin:0;
	width: 928px;
}
#access .menu-header ul,div.menu ul {
	list-style: none;
	margin: 0;
}
#access .menu-header li,div.menu li {
/*	float: left;
	position: relative;*/
}
/*
#access a {
	color: #aaa;
	display: block;
	line-height: 38px;
	padding: 0 10px;
	text-decoration: none;
}
#access ul ul {
	box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
	-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
	-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
	display: none;
	position: absolute;
	top: 38px;
	left: 0;
	float: left;
	width: 180px;
	z-index: 99999;
}
#access ul ul li {
	min-width: 180px;
}
#access ul ul ul {
	left: 100%;
	top: 0;
}
#access ul ul a {
	background: #333;
	line-height: 1em;
	padding: 10px;
	width: 160px;
	height: auto;
}
#access li:hover &gt; a,
#access ul ul :hover &gt; a {
	background: #333;
	color: #fff;
}
#access ul li:hover &gt; ul {
	display: block;
}
#access ul li.current_page_item &gt; a,
#access ul li.current-menu-ancestor &gt; a,
#access ul li.current-menu-item &gt; a,
#access ul li.current-menu-parent &gt; a {
	color: #fff;
}
* html #access ul li.current_page_item a,
* html #access ul li.current-menu-ancestor a,
* html #access ul li.current-menu-item a,
* html #access ul li.current-menu-parent a,
* html #access ul li a:hover {
	color: #fff;
}
*/
#access ul { width: 940px;
	margin: 0;
	padding: 7px 6px 0;
	line-height: 100%;
	border-radius: 2em;

	-webkit-border-radius: 2em;
	-moz-border-radius: 2em;

	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);

	background: #8b8b8b; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9', endColorstr='#7a7a7a'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#a9a9a9), to(#7a7a7a)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #a9a9a9,  #7a7a7a); /* for firefox 3.6+ */

	border: solid 1px #6d6d6d;
}
#access ul li {
	margin: 0 5px;
	padding: 0 0 8px;
	float: left;
	position: relative;
	list-style: none;
}
#access ul li.current_page_item a.level_0{}
/* main level link */
#access ul a {
	font-weight: bold;
	color: #e7e5e5;
	text-decoration: none;
	display: block;
	padding:  8px 20px;
	margin: 0;
	-webkit-border-radius: 1.6em;
	-moz-border-radius: 1.6em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
/* main level link hover */
#access ul li.current-menu-item a.level_0, #access ul li.current-menu-item a.level_0:hover, #access ul li:hover &gt; a {
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#access ul ul li:hover a, #access ul li:hover li a {
	background: none;
	border: none;
	color: #666;
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
}
#access ul ul a:hover {
	background: #0399d4 !important; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec', endColorstr='#0186ba'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#04acec), to(#0186ba)) !important; /* for webkit browsers */
	background: -moz-linear-gradient(top,  #04acec,  #0186ba) !important; /* for firefox 3.6+ */

	color: #fff !important;
	-webkit-border-radius: 0;
	-moz-border-radius: 0;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#access ul ul {
	background: #ddd; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cfcfcf'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#cfcfcf)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #fff,  #cfcfcf); /* for firefox 3.6+ */

	display: none;
	margin: 0;
	padding: 0;
	width: 185px;
	position: absolute;
	top: 35px;
	left: 0;
	border: solid 1px #b4b4b4;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#access ul li:hover &gt; ul {
	display: block;
}
#access ul ul li {
	float: none;
	margin: 0;
	padding: 0;
}
#access ul ul a {
	font-weight: normal;
	text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#access ul ul ul {
	left: 181px;
	top: -3px;
}
/* rounded corners for first and last child */
#access ul ul li:first-child &gt; a {
	-webkit-border-top-left-radius: 9px;
	-moz-border-radius-topleft: 9px;
	-webkit-border-top-right-radius: 9px;
	-moz-border-radius-topright: 9px;
}
#access ul ul li:last-child &gt; a {
	-webkit-border-bottom-left-radius: 9px;
	-moz-border-radius-bottomleft: 9px;
	-webkit-border-bottom-right-radius: 9px;
	-moz-border-radius-bottomright: 9px;
}

/* clearfix */
#access ul:after {
	content: &quot;.&quot;;
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}
#access ul {
	display: inline-block;
}
html[xmlns] #access ul {
	display: block;
}
* html #access ul {
	height: 1%;
}

#access ul li.current-menu-ancestor a.level_0{
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
#access ul ul li.current-menu-ancestor a{ }
</pre><p>Oh we need to add few lines in functions.php file for better support</p><p>open functions.php file and add at last</p><pre class="brush: php; title: ; notranslate">
function walker_nav_menu_start_el_adddepth($item_output, $item, $depth, $args)
{
    $item_output = str_replace('&lt;a href=&quot;', '&lt;a class=&quot;level_'.$depth.'&quot; href=&quot;',$item_output);
    return $item_output;

}
add_filter('walker_nav_menu_start_el','walker_nav_menu_start_el_adddepth', 10,4);
</pre><p>Also note that the css code will not work exactly if browser is not css3 supported or need to add some exception rules in some cases.<br /> Wait wait, you can do the same thing for joomla1.5 default template&#8217;s pillmenu(top main menu) and replace the pillmenu css with following, I think you know where to edit, if not then find yourself, I am busy.</p><pre class="brush: css; title: ; notranslate">
/* horizontal pill menu */
table.pill {
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}
/*
td.pill_l {
  background: url(../images/mw_menu_cap_l.png) no-repeat;
  width:  20px;
  height: 32px;

}

td.pill_m {
  background: url(../images/mw_menu_normal_bg.png) repeat-x;
  padding: 0;
  margin: 0;
  width: auto;
}

td.pill_r {
  background: url(../images/mw_menu_cap_r.png) no-repeat;
  width:  19px;
  height: 32px;
}

#pillmenu {
  white-space: nowrap;
  height: 32px;
  float: left;
}

#pillmenu ul {
  margin: 0;
  padding: 0;
  list-style:none;
}

#pillmenu li {
	float: left;
	background: url(../images/mw_menu_separator.png) top right no-repeat;
	margin: 0;
	padding: 0;
}

#pillmenu a {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
	float:left;
  display:block;
  height: 24px;
  line-height: 24px;
  padding: 0 20px;
  color: #000;
  text-decoration: none;
}

#pillmenu a#active_menu-nav {
	margin-top:2px;
	height: 21px;
	line-height: 21px;
	background-position: 0 0;
}
*/
#pillmenu {
	/*background: #000;*/
	display: block;
	float: left;
	margin: 0 auto;
	width: 940px;
}
#pillmenu .menu-header,
div.menu {
	font-size: 13px;
	margin:0;
	width: 928px;
}
#pillmenu .menu-header ul,div.menu ul {
	list-style: none;
	margin: 0;
}
#pillmenu .menu-header li,div.menu li {
/*	float: left;
	position: relative;*/
}
#pillmenu ul { width: 940px;
	margin: 0;
	padding: 7px 6px 0;
	line-height: 100%;
	border-radius: 2em;

	-webkit-border-radius: 2em;
	-moz-border-radius: 2em;

	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);

	background: #8b8b8b; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9', endColorstr='#7a7a7a'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#a9a9a9), to(#7a7a7a)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #a9a9a9,  #7a7a7a); /* for firefox 3.6+ */

	border: solid 1px #6d6d6d;
}
#pillmenu ul li {
	margin: 0 5px;
	padding: 0 0 8px;
	float: left;
	position: relative;
	list-style: none;
}
#pillmenu ul li.current_page_item a.level_0{}
/* main level link */
#pillmenu ul a {
	font-weight: bold;
	color: #e7e5e5;
	text-decoration: none;
	display: block;
	padding:  8px 20px;
	margin: 0;
	-webkit-border-radius: 1.6em;
	-moz-border-radius: 1.6em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
	text-align:left;
}
/* main level link hover */
#pillmenu ul li.active a, #pillmenu ul li.current-menu-item a.level_0:hover, #pillmenu ul li:hover &gt; a {
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#pillmenu ul ul li:hover a, #pillmenu ul li:hover li a {
	background: none;
	border: none;
	color: #666;
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
}
#pillmenu ul ul a:hover {
	background: #0399d4 !important; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec', endColorstr='#0186ba'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#04acec), to(#0186ba)) !important; /* for webkit browsers */
	background: -moz-linear-gradient(top,  #04acec,  #0186ba) !important; /* for firefox 3.6+ */

	color: #fff !important;
	-webkit-border-radius: 0;
	-moz-border-radius: 0;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#pillmenu ul ul {
	background: #ddd; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cfcfcf'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#cfcfcf)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #fff,  #cfcfcf); /* for firefox 3.6+ */
	display: none;
	margin: 0;
	padding: 0;
	width: 185px;
	position: absolute;
	top: 35px;
	left: 0;
	border: solid 1px #b4b4b4;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#pillmenu ul li:hover &gt; ul {
	display: block;
}
#pillmenu ul ul li {
	float: none;
	margin: 0;
	padding: 0;
}
#pillmenu ul ul a {
	font-weight: normal;
	text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#pillmenu ul ul ul {
	left: 181px;
	top: -3px;
}
/* rounded corners for first and last child */
#pillmenu ul ul li:first-child &gt; a {
	-webkit-border-top-left-radius: 9px;
	-moz-border-radius-topleft: 9px;
	-webkit-border-top-right-radius: 9px;
	-moz-border-radius-topright: 9px;
}
#pillmenu ul ul li:last-child &gt; a {
	-webkit-border-bottom-left-radius: 9px;
	-moz-border-radius-bottomleft: 9px;
	-webkit-border-bottom-right-radius: 9px;
	-moz-border-radius-bottomright: 9px;
}

/* clearfix */
#pillmenu ul:after {
	content: &quot;.&quot;;
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}
#pillmenu ul {
	display: inline-block;
}
/*
html[xmlns] #pillmenu ul {
	display: block;
}
* html #pillmenu ul {
	height: 1%;
}
*/

#pillmenu ul li.current-menu-ancestor a.level_0{
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
#pillmenu ul ul li.current-menu-ancestor a{ }
</pre><p>and see my output for a local site in joomla1.5 with default template.<br /> <img class="aligncenter size-full wp-image-664" title="css3dropdownloadmenu3" src="http://manchumahara.com/wp-content/uploads/2011/03/css3dropdownloadmenu3.png" alt="" width="557" height="250" /><br /> Thank you for reading.</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>How to Insert custom Quicktags into the WordPress Editor</title><link>http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/</link> <comments>http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/#comments</comments> <pubDate>Fri, 24 Dec 2010 19:31:00 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[editor]]></category> <category><![CDATA[quick tags]]></category><guid isPermaLink="false">http://manchumahara.com/?p=647</guid> <description><![CDATA[WordPress has two type of editor, one is visual/wysiwyw that is tinymce or replace with other such editors and another is HTML editor that is we call quick tag editor. Today, I want to write something about how to add &#8230; <a href="http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>WordPress has two type of editor, one is visual/wysiwyw that is tinymce or replace with other such editors and another is HTML editor that is we call quick tag editor. Today, I want to write something about how to add custom quick tags or custom buttons. I search about it in google and most guides to edit core quick tag javascript file. But I don&#8217;t like that and I made my own hack in my own way,  though experts may think it&#8217;s childish <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p>So let come to point, I wanted to add some buttons that will give me option to add custom class name  so that I can format the text well. Same thing can be done via Visual editor but you have to use a plugin named &#8220;<a href="http://wordpress.org/extend/plugins/tinymce-advanced/" target="_blank">Tinymce Advanced</a>&#8221; which helps to add more advance buttons like styles(class lists) and so on. But for HTML mode or  for quick tags editor I didn&#8217;t such plugins.<br /> <span id="more-647"></span><br /> Let&#8217;s start , output will be like the bellow image</p><p><img class="aligncenter size-full wp-image-648" title="quicktags" src="http://manchumahara.com/wp-content/uploads/2010/12/quicktags.png" alt="" width="839" height="198" /></p><h4>Step 1: Adding action for editor</h4><pre class="brush: php; title: ; notranslate">
add_action( 'edit_form_advanced', 'manchumahara_quicktags');
add_action( 'edit_page_form',');
</pre><h4>Step 2: Function to hook</h4><pre class="brush: php; title: ; notranslate">
function manchumahara_quicktags()
{

    ?&gt;
    &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
    // &lt;![CDATA[
        //edButton(id, display, tagStart, tagEnd, access, open)
        edbuttonlength = edButtons.length;
        edbuttonlength_t = edbuttonlength;
        //alert(edButtons);
        edButtons[edbuttonlength++] = new edButton('ed_itemname','Item Name','&lt;span class=&quot;itemleft&quot;&gt;','&lt;/span&gt;');
        edButtons[edbuttonlength++] = new edButton('ed_itemprice','Item Price','&lt;span class=&quot;itemprice&quot;&gt;','&lt;/span&gt;');
        edButtons[edbuttonlength++] = new edButton('ed_itemcaption','Item Caption','&lt;span class=&quot;itemcaption&quot;&gt;','&lt;/span&gt;');
            //alert(edButtons[edButtons.length]);
               (function(){

              if (typeof jQuery === 'undefined') {
                     return;
              }
              jQuery(document).ready(function(){
                     jQuery(&quot;#ed_toolbar&quot;).append('&lt;br/&gt;&lt;input type=&quot;button&quot; value=&quot;Item Name&quot; id=&quot;ed_itemname&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, edbuttonlength_t);&quot; title=&quot;Item Name&quot; /&gt;');
                     jQuery(&quot;#ed_toolbar&quot;).append('&lt;input type=&quot;button&quot; value=&quot;Item Price&quot; id=&quot;ed_itemprice&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, edbuttonlength_t+1);&quot; title=&quot;Item Price&quot; /&gt;');
                     jQuery(&quot;#ed_toolbar&quot;).append('&lt;input type=&quot;button&quot; value=&quot;Item Caption&quot; id=&quot;ed_itemcaption&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, edbuttonlength_t+2);&quot; title=&quot;Item Caption&quot; /&gt;');
              });
       }());
    // ]]&gt;
    &lt;/script&gt;
    &lt;?php

}
</pre><p>Explanation: Here I have added three buttons named &#8220;Itemname&#8221;, &#8220;Itemprice&#8221; and &#8220;Itemcaption&#8221;  and after those buttons are clicked  with some text selected each will  put a span class and so so&#8230;</p><p>I have used jquery to push the buttons to edButtons  array. To see how the quick tag js works see the file in wp-inclides/js/quicktags.dev.js  for better sense.</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>WP Photo Album Plus Plus: WordPress Image Gallery</title><link>http://manchumahara.com/2010/08/28/wp-photo-album-plus-plus-wordpress-image-gallery/</link> <comments>http://manchumahara.com/2010/08/28/wp-photo-album-plus-plus-wordpress-image-gallery/#comments</comments> <pubDate>Sat, 28 Aug 2010 11:47:55 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[wordpress]]></category> <category><![CDATA[Wordpress Plugin]]></category> <category><![CDATA[image gallery]]></category> <category><![CDATA[plugin]]></category><guid isPermaLink="false">http://manchumahara.com/?p=594</guid> <description><![CDATA[Most of the wordpress image gallery plugins can not make me happy. NExtgen is too much heavy, then I got another wordpress plugin &#8220;WP Photo Album Plus&#8221; developed by J.N. Breetvelt, a.k.a. (OpaJaap). R.J. Kaplan developed WP Photo Album 1.5.1 &#8230; <a href="http://manchumahara.com/2010/08/28/wp-photo-album-plus-plus-wordpress-image-gallery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Most of the wordpress image gallery plugins can not make me happy. NExtgen is too much heavy, then I got another wordpress plugin &#8220;<a href="http://wordpress.org/extend/plugins/wp-photo-album-plus/">WP Photo Album Plus</a>&#8221; developed by J.N. Breetvelt, a.k.a. <a href="http://www.opajaap.nl/"> (OpaJaap)</a>. R.J. Kaplan developed WP Photo Album 1.5.1 and then J.N. Breetvelt extended it with new features. Really I like this simple but powerfull gallery plugin. But something I didn&#8217;t like which I am trying to modify and releasing for every body so that I can get more ideas from other and even this modification can be done to main plugin too. <strong> Though my modification is not done yet! But why not I share my last modification and explain what I have done upto now <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong><br /> <span id="more-594"></span><br /><dl id="attachment_595" class="wp-caption aligncenter" style="width: 645px"><dt><img class="size-full wp-image-595" title="gallery1" src="http://manchumahara.com/wp-content/uploads/2010/08/gallery1.png" alt="" width="635" height="209" /></dt><dd class="wp-caption-text">Gallerific image gallery with wp photo albumm plus plus</dd></dl></p><p><strong>Change in Backend:</strong></p><ul><li>Added pagination in backend for album listing</li><li>Added pagination in backend for file/image listing, sites having large amount of images in each gallery should like this feature.</li><li>Image will not list while edit any album. Better way to edit or view images for any album in backend.</li><li>Changed backend design a little for easy navigation to other options. More will be done.</li><li>Now thumb can be made squre so that it does&#8217;t look ugly and diff sizes</li><li>Added midium size thumb so that you can place image size that you want as big size but original one is always kept so that you can regenerate all thumbs again.</li></ul><p><strong>Change in Front end:</strong></p><ul><li>Replaced the old slideshow with  new slideshow using  jquery based image slideshow plugin <a href="http://www.twospy.com/galleriffic/" target="_blank">Galleriffic</a>. You may need to edit style if currrent setting doesn&#8217;t match your style. You can select black or white combination. Need to do more work though. Current <a href="http://www.twospy.com/galleriffic/example-5.html">gallerific style</a> is used.</li></ul><p><strong>Todo list:</strong></p><ul><li>So many things so don&#8217;t wana write so long list <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></li><li>One thing must to do for replaceing the normal regex based shortcode with wordpress default shortcode method to add gallery in a page.</li></ul><p>Note: There is a file embedded within this post, please visit this post to download the file.<br /> I am attaching the current modified version so that you can test and give me some feedback. If  any one need any jquery based custom slideshow with it let me know(to hire professionaly <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/08/28/wp-photo-album-plus-plus-wordpress-image-gallery/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/08/28/wp-photo-album-plus-plus-wordpress-image-gallery/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Adding vertical fixed feedback button</title><link>http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/</link> <comments>http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/#comments</comments> <pubDate>Wed, 25 Aug 2010 11:50:00 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[Wordpress Themes]]></category> <category><![CDATA[css]]></category> <category><![CDATA[html]]></category><guid isPermaLink="false">http://manchumahara.com/?p=592</guid> <description><![CDATA[update: 06.09.2010 Wana use as wordpress or joomla plugin ? then buy from my official website Downloads For Joomla For WordPress The Story If you still didn&#8217;t notice, please check again there is a vertical feedback button in my blog &#8230; <a href="http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>update: 06.09.2010<br /> Wana use as wordpress or joomla plugin ? then buy from my official website</p><h4>Downloads</h4><p><a href="http://idea52.com/product/fixed-vertical-feedback-button-for-joomla">For Joomla</a><br /> <a href="http://idea52.com/product/fixed-vertical-feedback-button-for-wordpress">For WordPress</a></p><h4>The Story</h4><p>If you still didn&#8217;t notice, please check again there is a vertical feedback button in my blog , right side. So, sometimes people asks me how to do that ,,, any one can read the source code or having debug tool like <a href="http://getfirebug.com/" target="_blank">firebug</a> for firefox can see the source code and add in his own site. But max time, it&#8217;s true that we don&#8217;t want to learn by reading or google about any problem, we just ask other to get ready made solution. Even we don&#8217;t write in forums about our problems &#8230;. grr&#8230;</p><p>So here is answer of the those question, &#8220;How I added the vertical feedback button?&#8221;</p><p>I know how html works and how css works , I know where to edit in wordpress theme. So many days ago I saw that in a site and copied the source code and image and added in my site <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br /> <strong>I am showing for default wordpress theme tweentyten</strong> and all paths shown bellow are windows style as windows is my primary os.</p><p><strong>Step1:</strong> Copy this <a href="http://manchumahara.com/wp-content/uploads/2010/08/feedback_tab_white.png">image</a> to your wp-contentthemestwentytenimages folder first.</p><p><strong>Step2:</strong> Open style.css file from wp-contentthemestwentyten  dir and ready to add some css code <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br /> Step3: In the file style.css file at last line add the following css codes<br /> <span id="more-592"></span></p><pre class="brush: css; title: ; notranslate">
body &gt; a#feedbackright {
background:url(&quot;images/feedback_tab_white.png&quot;) no-repeat scroll 50% 50% #0066CC;
display:block;
height:90px;
line-height:0;
padding:5px;
position:fixed;
right:0;
/*left:0;*/
text-indent:-99999px;
top:50%;
width:22px;
}
body &gt; a#feedbackright:hover {
background-color:#FF8B00;
}
</pre><p>Here if you want to show in  left side then comment the right:0; line and uncomment the line left:0; Also if you want to up down the position of the feedback button then edit the value for top:50%</p><p><strong>Step3.: </strong>Open footer.php from the same dir of style.css file and go to bottom of that file to add the following lines after the end of wrapper div(<strong>here I have added the end tag of wrapper div so that you get easily</strong>)</p><pre class="brush: xml; title: ; notranslate">&lt;/div&gt;&lt;!-- #wrapper --&gt;
&lt;a href=&quot;&lt;?php echo get_permalink(here will be your contact page id); ?&gt;&quot; id=&quot;feedbackright&quot;&gt;feedback&lt;/a&gt;</pre><p>look in the above code there is something &#8220;here will be your contact page id&#8221;  you have to replace this text with your contact page id. if you don&#8217;t know how to get page id then you can install <a href="http://sivel.net/wordpress/simply-show-ids/">this wordpress plugin</a> and activate, then go to any menu from left column for listing like posts, pages, categories, tags etc you will see an extra line at right col for id. Ok let your contact page id is 2 then the line will be like</p><p>note: here I am writing the last tag of wrapper div</p><pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;&lt;?php echo get_permalink(2); ?&gt;&quot; id=&quot;feedbackright&quot;&gt;feedback&lt;/a&gt;</pre><p>Step4: now it&#8217;s time you do it and let me know.</p><blockquote><p>Wana use as wordpress or joomla plugin ? then buy from my official website</p><h4>Downloads</h4><p><a href="http://idea52.com/product/fixed-vertical-feedback-button-for-joomla">For Joomla</a><br /> <a href="http://idea52.com/product/fixed-vertical-feedback-button-for-wordpress">For WordPress</a></p></blockquote>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Adding My posts sub menu for posts section in wordpress</title><link>http://manchumahara.com/2010/08/14/adding-my-posts-sub-menu-for-posts-section-in-wordpress/</link> <comments>http://manchumahara.com/2010/08/14/adding-my-posts-sub-menu-for-posts-section-in-wordpress/#comments</comments> <pubDate>Sat, 14 Aug 2010 11:59:23 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[Wordpress Plugin]]></category> <category><![CDATA[hack]]></category><guid isPermaLink="false">http://manchumahara.com/?p=588</guid> <description><![CDATA[Let me explain the situation. Suppose you have contributor access to wordpress. If you go to posts page in admin panel that list all posts   and here you are not author of all posts.  you will see the url like &#8230; <a href="http://manchumahara.com/2010/08/14/adding-my-posts-sub-menu-for-posts-section-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Let me explain the situation. Suppose you have contributor access to wordpress. If you go to posts page in admin panel that list all posts   and here you are not author of all posts.  you will see the url like</p><pre class="brush: php; title: ; notranslate">edit.php?post_type=post&amp;all_posts=1</pre><p> and All( total post number here). There will be another menu named Mine(Current user post number). All link is default. So we can make nother submenu of posts in admin section for Mine link directly. Let me show you the few lines code.</p><pre class="brush: php; title: ; notranslate">add_action('admin_menu', 'manchu_myposts');
function manchu_myposts()
{
    if (function_exists('add_submenu_page'))
    {
		//$parent, $page_title, $menu_title, $access_level, $file, $function = ''
		add_submenu_page('edit.php','My Posts','My posts', 1, 'edit.php?post_type=post&amp;author='.get_current_user_id());
    }
}</pre><p>You can copy-paste  above code in your theme functions.php file and it will show a new sub menu in posts ectin as My posts. Multi user blog users can get easily link for his/her posts.<br /> <img src="http://manchumahara.com/wp-content/uploads/2010/08/myposts.png" alt="myposts" title="myposts" width="509" height="234" class="size-full wp-image-589" /><br /> it&#8217;s just a easy way to make personal posts link for any user have access at leas contributor. Access level 1  belongs to contributor..</p><p>Update: 15-09-2011</p><p>While working on a project I got a tips from stackoverflow wordpress site about showing only specific author&#8217;s posts in author mode.</p><pre class="brush: php; title: ; notranslate">
function cb_posts_for_current_author($query) {
     global $pagenow;

     if( 'edit.php' != $pagenow || !$query-&gt;is_admin )
     return $query;

     if( !current_user_can( 'manage_options' ) ) {
     global $user_ID;
     $query-&gt;set('author', $user_ID );
     }
     return $query;
}
add_filter('pre_get_posts', 'cb_posts_for_current_author');
</pre><p>thank you</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/08/14/adding-my-posts-sub-menu-for-posts-section-in-wordpress/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/08/14/adding-my-posts-sub-menu-for-posts-section-in-wordpress/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Stuck in wordpress Maintenance Mode?</title><link>http://manchumahara.com/2010/07/24/stuck-in-wordpress-maintenance-mode/</link> <comments>http://manchumahara.com/2010/07/24/stuck-in-wordpress-maintenance-mode/#comments</comments> <pubDate>Fri, 23 Jul 2010 18:33:06 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://manchumahara.com/?p=585</guid> <description><![CDATA[Are you Stuck in wordpress Maintenance Mode?  I was in that situation and thought to write about my pain and findings so that it may be help to reduce pain in the ass when u are crazy to do some &#8230; <a href="http://manchumahara.com/2010/07/24/stuck-in-wordpress-maintenance-mode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Are you <strong>Stuck in wordpress Maintenance Mode</strong>?  I was in that situation and thought to write about my pain and findings so that it may be help to reduce pain in the ass when u are crazy to do some upgrade for plugins and themes and you are stuck  in maintenance mode for &#8220;<strong>something wrong</strong>&#8221; in upgrade/upadte process .</p><p><strong><em>This tip is for wordpress3.0+</em></strong>, don&#8217;t  know what to do for lower version.  The thing is when wordpress takes the site maintenace mode it creates a file in the site root dir named .maintenance  and when done remove that&#8230; <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>So, now you know what to do if u are stuck in maintenance mode. I wish I am going to sleep well tonight.</p><p>note: check the dicussion in <a href="http://wordpress.org/support/topic/411417?replies=4" target="_blank">wordpress forum</a> about this issue.</p><p>btw, let me show you a sample screenshot about how the error msg look for upgrade failure</p><p><a href="http://manchumahara.com/wp-content/uploads/2010/07/wpautofail.png"><img class="alignleft size-full wp-image-587" title="wpautofail" src="http://manchumahara.com/wp-content/uploads/2010/07/wpautofail.png" alt="failure" width="644" height="43" /></a></p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/07/24/stuck-in-wordpress-maintenance-mode/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/07/24/stuck-in-wordpress-maintenance-mode/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Facebook fanbox wordpress plugin</title><link>http://manchumahara.com/2010/06/30/facebook-fanbox-wordpress-plugin/</link> <comments>http://manchumahara.com/2010/06/30/facebook-fanbox-wordpress-plugin/#comments</comments> <pubDate>Wed, 30 Jun 2010 00:36:34 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[wordpress]]></category> <category><![CDATA[facebook]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[widget]]></category> <category><![CDATA[Wordpress Plugin]]></category><guid isPermaLink="false">http://manchumahara.com/?p=575</guid> <description><![CDATA[It&#8217;s just a simple fanbox widget as wordpress plugin, nothing to explain. But I made my own version ? Features iframe method auto detect ie(internet explorer), because sometimes it&#8217;s make problem for ie and option to use as iframe only &#8230; <a href="http://manchumahara.com/2010/06/30/facebook-fanbox-wordpress-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>It&#8217;s just a simple fanbox widget as wordpress plugin, nothing to explain. But I made my own version ?</p><h4>Features</h4><ul><li>iframe method</li><li> auto detect ie(internet explorer), because sometimes it&#8217;s make problem for ie and option to use as iframe only for ie !</li><li>jquery based document ready facebook load ! Not clear ? see bellow</li></ul><p>One thing to note that I used a way to load the facebook js script after loading jquery as normally in wordpress site front end we use jquery and many plugin uses this&#8230; so we can take that jquery is using default. So I loaded the fb js using wp_enqueue function and then called the fb init function after the document is loaded using jquery dom ready function <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> &#8230; It&#8217;s just an experiment about slow loading of facebook fanbox widget in wordpress <img src='http://manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p><h4>Download</h4> Note: There is a file embedded within this post, please visit this post to download the file.<p>If you just download with no comment and no recommendation to others, then I am planning to hate  you <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br /> Man at least share in social network and give me traffic so that I can have  more money from ads <img src='http://manchumahara.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p><p>Good morning. It&#8217;s just morning after working whole night and I am feeling too hungry <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br /> <span id="more-575"></span></p><h4>Code Example</h4><pre class="brush: php; title: ; notranslate">
	function widget( $args, $instance ) {
		extract( $args );
                 global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
		/* Our variables from the widget settings. */
		$title          = apply_filters('widget_title', $instance['title'] );
		$profileid      = $instance['profileid']; //name or profile id , not both
		$apikey         = isset( $instance['apikey'])? $instance['apikey'] : '';
                $stream         = isset( $instance['stream'] ) ? $instance['stream'] : 0;
                $connections    = isset( $instance['connections'] )? (($instance['connections'] &gt; 100)? 100: intval($instance['connections'])): 10; //Specifying 0 hides the list of fans in the Fan Box. You cannot display more than 100 fans. (Default value is 10 connections.)
                $width          = isset( $instance['width'] )? (($instance['width'] &lt; 200)? 200: intval($instance['width'])): 300; // at least 200 pixels wide at minimum. (Default value is 300 pixels.)
                $height         = isset( $instance['height'] )? $instance['height']: 554;
                $css            = isset( $instance['css']) ? $instace['css']:'';
                $logobar        = isset( $instance['logobar'] ) ? $instance['logobar'] : 1;
                $iframe         = isset( $instance['iframe'])? $instance['iframe'] : 0;
                $locale         = isset( $instance['locale'])? $instance['locale']: 'en_US';
                $iframeie       = isset( $instance['iframeie'] ) ? $instance['iframeie'] : 1; // use iframe for ie , auto detect
                $usejquery     = isset( $instance['usejquery'] ) ? $instance['usejquery'] : 1;
		/* Before widget (defined by themes). */
                //var_dump($iframe);
		echo $before_widget;

		/* Display the widget title if one was input (before and after defined by themes). */
		if ( $title )
                {
                    echo $before_title . $title . $after_title;
                }

                if(($is_IE &amp;&amp; $iframeie) || $iframe || $apikey == '')
                {
                    //echo 'yes';
                    echo '&lt;iframe scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;http://www.facebook.com/connect/connect.php?id='.$profileid.'&amp;amp;stream='.$stream.'&amp;amp;connections='.$connections.'&amp;amp;logobar='.$logo.'&amp;amp;css='.$css.'?'.mktime().'&quot; style=&quot;border: none; width: '.$width.'px; height:'.$height.'px;&quot;&gt;&amp;nbsp;&lt;/iframe&gt;';
                }
                else
                {
                    if($usejquery)
                    {
                        wp_enqueue_script('fbjs', 'http://static.ak.connect.facebook.com/connect.php/en_US', array('jquery'), null);
                        echo '&lt;fb:fan profile_id=&quot;'.$profileid.'&quot; width=&quot;'.$width.'&quot; connections=&quot;'.$connections.'&quot; stream=&quot;'.$stream.'&quot; header=&quot;'.$logobar.'&quot;&gt;&lt;/fb:fan&gt;';
                        echo '&lt;script type=&quot;text/javascript&quot;&gt;jQuery(document).ready(function() {
                                FB.init(&quot;'.$apikey.'&quot;);
                                });&lt;/script&gt;';
                    }
                    else
                    {
                            echo '&lt;script type=&quot;text/javascript&quot; src=&quot;http://static.ak.connect.facebook.com/connect.php/en_US&quot;&gt;&lt;/script&gt;';
                            echo '&lt;script type=&quot;text/javascript&quot;&gt; FB.init(&quot;'.$apikey.'&quot;); &lt;/script&gt;';
                    }
                }                             

		/* After widget (defined by themes). */
		echo $after_widget;
	}
</pre>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/06/30/facebook-fanbox-wordpress-plugin/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/06/30/facebook-fanbox-wordpress-plugin/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 23/111 queries in 0.122 seconds using disk: basic
Object Caching 1073/1171 objects using disk: basic

Served from: manchumahara.com @ 2012-02-05 17:47:41 -->
