Show/Hide comment status text in wordpress

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 “Comments are closed” 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’s put a trick in theme to show the comment text(comment status in more smart way)

In latest wordpress version the loop is in the loop.php file in the theme folder. So for comment we will get this line

[code language=”php”]
<?php comments_template( ”, true ); ?
[/code]

But how about we put

[code language=”php”]
<?php if($post->comment_status == "open"){comments_template( ”, true );} ?>
[/code]

That means if comment is off then we will not show any text like “Comments are closed” . I strongly believe this trick will make the design clean in some condition 😛

Thank you

Vacation is already great :)

Just back from a long and great vacation 🙂 May be thing last two years, I didn’t take such long break, around 14 days, yes it’s true 🙂 Had lots of fun with Family mates. First time some one from my family came dhaka to meet me, My senior brother and sister came to my place in dhaka , I was so happy to see them.

Senior Brother(Sumon) and Sister in law(Vabi) -Sanchita


Continue reading

How to Insert custom Quicktags into the WordPress Editor

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’t like that and I made my own hack in my own way, though experts may think it’s childish 😛

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 “Tinymce Advanced” 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’t such plugins.
Continue reading

WP Photo Album Plus Plus: WordPress Image Gallery

Most of the wordpress image gallery plugins can not make me happy. NExtgen is too much heavy, then I got another wordpress plugin “WP Photo Album Plus” developed by J.N. Breetvelt, a.k.a. (OpaJaap). 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’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. Though my modification is not done yet! But why not I share my last modification and explain what I have done upto now 🙂
Continue reading

āĻŦ⧃āĻˇā§āϟāĻŋāĻšā§€āύ āĻŦ⧃āĻˇā§āϟāĻŋāϰ āύāĻ—āϰ⧇

āĻāĻŋāϰ āĻāĻŋāϰ āĻŦ⧃āĻˇā§āϟāĻŋāϤ⧇ āϚāĻŽāĻļāĻžāϰ āĻ•āĻžāĻšā§‡ āφāĻļā§āϰ⧟ āύāĻŋā§Ÿā§‡āϛ⧇ āĻ…āϞāϏ āĻŦ⧃āĻˇā§āϟāĻŋ āĻĢā§‹āϟāĻž,
āĻŽā§āĻ›āϤ⧇ āχāĻšā§āĻ›āĻž āĻ•āϰāϛ⧇ āύāĻžāĨ¤
āĻŦ⧃āĻˇā§āϟāĻŋāϰ āϕ⧋āύ āĻĢā§‹āϟāĻžāϤ⧇ āϝāĻ–āύ āφāϞ⧋ āĻĒ⧜āϛ⧇ āĻšā§‹āĻ– āφāĻ¸ā§āϤ⧇ āφāĻ¸ā§āϤ⧇ āĻāĻžāĻĒā§āϏāĻž āĻšā§Ÿā§‡ āϝāĻžāĻšā§āϛ⧇
āφāϰ
āϚāϞ⧇ āϝāĻžāĻšā§āĻ›āĻŋ āĻ…āĻšā§‡āύāĻž āϕ⧋āύ āύāĻ—āϰ⧇
āϝ⧇āĻ–āĻžāύ⧇
āĻœā§‡āϗ⧇ āĻĨāĻžāĻ•āĻŋ āĻŦ⧃āĻˇā§āϟāĻŋāĻšā§€āύ āĻŦāĻ›āϰ⧇āϰ āĻĒāϰ āĻŦāĻ›āϰāĨ¤

āĻŦāĻ¨ā§āϧ⧁ āϤ⧋āϰ āύāĻ—āϰ⧇ āϝāĻĻāĻŋ āĻŦ⧃āĻˇā§āϟāĻŋ āύāĻž āĻšā§Ÿ āφāĻŽāĻžāϕ⧇ āϜāĻžāύāĻžāύ āĻĻāĻŋāϏ,
āϰāĻ‚ā§Ÿā§‡āϰ āĻšāĻŋāϏāĻžāĻŦ āϭ⧁āϞ⧇ āϧāĻžāϰ āĻĻāĻŋā§Ÿā§‡ āĻĻ⧇āĻŦā§‹ āφāĻŽāĻžāϰ āϚāĻŽāĻļāĻžāϰ āĻ•āĻžāρāĻšā§‡ āϜāĻŽāĻž āĻŦ⧃āĻˇā§āϟāĻŋā§āϰ āĻĢā§‹āϟāĻžāϗ⧁āϞ⧋āĨ¤āĨ¤

Adding My posts sub menu for posts section in wordpress

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
[code language=”php”]edit.php?post_type=post&all_posts=1[/code] 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.
[code language=”php”]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&author=’.get_current_user_id());
}
}[/code]
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.
myposts
it’s just a easy way to make personal posts link for any user have access at leas contributor. Access level 1 belongs to contributor..

Update: 15-09-2011

While working on a project I got a tips from stackoverflow wordpress site about showing only specific author’s posts in author mode.
[code language=”php”]
function cb_posts_for_current_author($query) {
global $pagenow;

if( ‘edit.php’ != $pagenow || !$query->is_admin )
return $query;

if( !current_user_can( ‘manage_options’ ) ) {
global $user_ID;
$query->set(‘author’, $user_ID );
}
return $query;
}
add_filter(‘pre_get_posts’, ‘cb_posts_for_current_author’);
[/code]

thank you

Stuck in wordpress Maintenance Mode?

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 upgrade for plugins and themes and you are stuck  in maintenance mode for “something wrong” in upgrade/upadte process .

This tip is for wordpress3.0+, don’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… 🙂

So, now you know what to do if u are stuck in maintenance mode. I wish I am going to sleep well tonight.

note: check the dicussion in wordpress forum about this issue.

btw, let me show you a sample screenshot about how the error msg look for upgrade failure

failure

Facebook fanbox wordpress plugin

It’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’s make problem for ie and option to use as iframe only for ie !
  • jquery based document ready facebook load ! Not clear ? see bellow

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… 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 😛 … It’s just an experiment about slow loading of facebook fanbox widget in wordpress 😀

Download

[download id=”23″]

If you just download with no comment and no recommendation to others, then I am planning to hate you 😛
Man at least share in social network and give me traffic so that I can have more money from ads 🙁

Good morning. It’s just morning after working whole night and I am feeling too hungry 🙂
Continue reading

āϜ⧁āĻŽāϞāĻžāϤ⧇ āύ⧇āϟāĻŋāĻ­ āϟ⧁āϞāϟāĻŋāĻĒ āĻāϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ

Hei! it’s bengali unicode text, This post is wrriten for amaderprojukti forum.
āĻ…āύ⧇āĻ• āĻĻāĻŋāύ āĻŦāĻžāĻ‚āϞāĻžāϝāĻŧ āĻŦā§āϞāĻ— āĻŦāĻž āϟāĻŋāĻĒā§āϏ āĻ•āĻŋāϛ⧁ āϞ⧇āĻ–āĻž āĻšāϝāĻŧ āύāĻžāĨ¤ āφāϜāϕ⧇āϰ āĻŦāĻŋāώāϝāĻŧ āφāĻŽāĻžāϰ āĻ…āύ⧇āĻ• āϗ⧁āϞ⧋ āĻ—āĻžāĻ°ā§āϞāĻĢā§āϰ⧇āĻ¨ā§āĻĄ āĻāϰ āϭ⧇āϤāϰ āĻ…āĻ¨ā§āϝāϤāĻŽ “āϜ⧁āĻŽāϞāĻž”āĨ¤ āϝāĻĻāĻŋāĻ“ āφāϜāϕ⧇āϰ āϞ⧇āĻ–āĻžāϟāĻž āϜ⧁āĻŽāϞāĻžāϰ āĻāĻ•āϟāĻŋ āĻ—ā§‹āĻĒāύ āϏ⧁āĻ¨ā§āĻĻāϰ āĻĻāĻŋāĻ• āύāĻŋāϝāĻŧ⧇ āφāϰ āϤāĻž āĻšāϞ⧋ āϜ⧁āĻŽāϞāĻž ā§§.ā§Ģ āĻāϰ āύ⧇āϟāĻŋāĻ­ āϟ⧁āϞāϟāĻŋāĻĒāĨ¤
āĻĒā§āϰāĻĨāĻŽ āĻāĻ•āϟāĻŋ āĻ›āĻŦāĻŋ āĻĻ⧇āĻ–āĻžāϝāĻŧāσ
tooltip
āĻāĻĄāĻŽāĻŋāύ āĻĒā§āϝāĻžāύ⧇āϞ⧇ āϕ⧋āύ āĻ•āĻŋāϛ⧁ āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ⧇āĻļāύ⧇ āĻĸ⧁āĻ•āϞ⧇ āĻŦāĻž āĻ…āύ⧇āĻ• āϏāĻŽāϝāĻŧ āϕ⧋āύ āϞāĻŋāĻ™ā§āĻ•āĻ āĻŽāĻžāωāϏ āĻšā§‹āĻ­āĻžāϰ āĻ•āϰāϞ⧇ āωāĻĒāϰ⧇āϰ āĻŽāϤ⧋ āϟ⧁āϞāϟāĻŋāĻĒ āĻĻ⧇āĻ–āĻžāϝāĻŧāĨ¤ āĻāĻ•āχ āϰāĻ•āĻŽ āϟ⧁āĻĒāϟāĻŋāĻĒ āϚāĻžāχāϞ⧇ āφāĻŽāϰāĻž āĻĢā§āϰāĻ¨ā§āϟ āĻāĻ¨ā§āĻĄ āĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŋ āφāϰ āϤāĻžāϰ āϜāĻ¨ā§āϝ āĻāĻ•ā§āϟāĻŋāĻ­ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āĻŸā§‡ āĻĻāϰāĻ•āĻžāϰ āϏāĻžāĻŽāĻžāĻ¨ā§āϝ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ, āϏ⧇āχ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻ•āϰāĻž āϝāĻžāϝāĻŧ āϤāĻž āύāĻŋāϝāĻŧ⧇āχ āφāϜāϕ⧇āϰ āφāϞ⧋āϚāύāĻžāĨ¤ āĻĒāϰ⧇āϰ āĻ›āĻŦāĻŋāϟāĻŋ āĻĢā§āϰāĻ¨ā§āϟ āĻāĻ¨ā§āĻĄ āĻāϰāĨ¤
tootip

āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻĢā§āϰāĻ¨ā§āϟ āĻāĻ¨ā§āĻĄā§‡ āϟ⧁āϞāϟāĻŋāĻĒ āĻĢāĻŋāϚāĻžāϰ āϝ⧁āĻ•ā§āϤ āĻ•āϰāĻŦ⧇āύāσ
āϟ⧁āϞāϟāĻŋāĻĒ āĻĢāĻŋāϚāĻžāϰ āϝ⧁āĻ•ā§āϤ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āφāĻĒāύāĻžāϕ⧇ āĻĒā§āϰāĻĨāĻŽ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āĻŸā§‡āϰ āχāĻ¨ā§āĻĄā§‡āĻ•ā§āϏ āĻĢāĻžāχāϞ(index.php) āĻ āĻāĻ•āϟāĻŋ āϞāĻžāχāύ āϝ⧁āĻ•ā§āϤ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇āĨ¤ āϝāĻĻāĻŋ āφāĻĒāύāĻŋ āĻĄāĻŋāĻĢāĻ˛ā§āϟ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇āύ āϤāĻžāĻšāϞ⧇ rhuk_milkyway āĻšāĻšā§āϛ⧇ āφāĻĒāύāĻžāϰ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āĻāϰ āύāĻžāĻŽ, āĻāϰ āϭ⧇āϤāϰ index.php āĻĢāĻžāχāϞāϟāĻŋ āĻ“āĻĒ⧇āύ āĻ•āϰ⧁āύ āϕ⧋āύ āĻāĻĄāĻŋāϟāϰ⧇, āĻāĻ–āύ āĻšā§‡āĻĄ āĻŸā§āϝāĻžāĻ—() āĻāϰ āφāϗ⧇

Continue reading

āĻĻ⧇āĻ“ā§ŸāĻžāϞ

āĻāĻ•āϟāĻž āωāϚ⧁ āĻĻ⧇āĻ“ā§ŸāĻžāϞ⧇āϰ āϏāĻžāĻŽāύ⧇ āĻĒā§āϰāϤāĻŋāĻĻāĻŋāύāχ āĻĻāĻžāρ⧜āĻžā§Ÿ āφāϰ
āĻ­āĻžāĻŦāĻŋ āĻāχ āĻĻ⧇āĻ“ā§ŸāĻžāϞāϟāĻžāϰ āϤ⧈āϰāĻŋ āύāĻž āĻšāϞ⧇ āĻ•āĻŋ āϖ⧁āĻŦ āĻ•ā§āώāϤāĻŋ āĻšāϤ⧋ ?

āĻŽāĻžāĻā§‡ āĻŽāĻžāĻā§‡ āĻ­āĻžāĻŦāĻŋ āĻĻ⧇āĻ“ā§ŸāĻžāϞāϟāĻŋ āϜāĻŦāϰāĻĻāĻ¸ā§āϤāĻŋ āĻ•āϰ⧇ āϭ⧇āĻ™ā§āϗ⧇ āĻĢ⧇āϞāĻŋ āĻ•āĻŋāĻ‚āĻŦāĻž
āĻāϤ⧋ āĻĻā§‚āϰ⧇ āĻĒāĻžāϞāĻŋā§Ÿā§‡ āϝāĻžā§Ÿ āϝ⧇āĻ–āĻžāύ āĻĨ⧇āϕ⧇ āφāĻŽāĻŋ āϚāĻžāχāϞ⧇āĻ“ āĻāχ āĻĻ⧇āĻ“ā§ŸāĻžāϞ⧇āϰ āĻ•āĻžāϛ⧇ āφāϏāϤ⧇ āĻĒāĻžāϰāĻŦā§‹ āύāĻž … āĻšā§‡ āĻšā§‡

āϧāϰ⧇ āύāĻŋāϞāĻžāĻŽ, āφāĻŽāĻŋ āĻĻ⧇āĻ“ā§ŸāĻžāϞ āϭ⧇āĻ™ā§āϗ⧇ āĻĢ⧇āϞ⧇āĻ›āĻŋ āĻ•āĻŋāĻ¨ā§āϤ⧁
āĻāχāϝ⧇ āĻāϤ⧋ āĻŦāĻ›āϰ āϧāϰ⧇ āĻŽāύ⧇āϰ āϭ⧇āϤāϰ āφāϰ āĻāĻ• āĻŦāĻŋāĻļāĻžāϞ āĻĻ⧇āĻ“ā§ŸāĻžāϞ āϤ⧈āϰāĻŋ āĻšā§Ÿā§‡āĻ›āĻŋ āϏ⧇āϟāĻžāϰ āĻ•āĻŋ āĻšāĻŦ⧇ ?

āĻ­āĻžāĻŦāϛ⧋ āφāĻŽāĻŋ āύāĻŋāϰāĻžāĻļāĻžāĻŦāĻžāĻĻā§€ … āĻšā§‡ āĻšā§‡ āύāĻž āĻ āĻŋāĻ• āϤ⧇āĻŽāύāϟāĻŋ āύ⧟, āφāĻŽāĻŋ āϜāĻžāύāĻŋ āφāĻŽāĻŋ āĻāĻ•āĻĻāĻŋāύ āĻāχ āĻŽāύ⧇āϰ āĻĻ⧇āĻ“ā§ŸāĻžāϞāĻ“ āϭ⧇āϙ⧇ āĻĢ⧇āϞāĻŦā§‹, āϤāĻžāϰāĻĒāϰ ?
āĻĻ⧇āĻ“ā§ŸāĻžāϞ⧇āϰ āĻ“āĻĒāĻžāĻļ⧇ āϝāĻž āφāĻļāĻž āĻ•āϰ⧇āĻ›āĻŋāϞāĻžāĻŽ āϤāĻž āĻĨāĻžāĻ•āĻŦ⧇āϤ⧋, āύāĻžāĻ•āĻŋ āϏāĻŦāχ āĻĢāĻžāρāĻ•āĻŋāĨ¤āĨ¤

āĻ­āĻžāĻŦāĻ›āĻŋ āĻĻ⧇āĻ“ā§ŸāĻžāϞ⧇āϰ āĻĒā§āϰāϤāĻŋāĻĒāĻžāϞāĻ•āϕ⧇ āϧāĻŽāĻ• āĻĻāĻŋā§Ÿā§‡ āĻŦāϞāĻŋ,
āĻĢāĻžāϜāϞāĻžāĻŽāĻŋ āĻĒāĻžāχāϛ⧋, āχāĻšā§āĻ›āĻž āĻšāχāϞ⧋ āφāϰ āĻĻ⧇āĻ“ā§ŸāĻžāϞ āϤ⧁āϞ⧇ āĻŽāϜāĻž āĻĻ⧇āĻ–ā§‹ āύāĻž ?
———————————————————————————-
⧍ā§Ģ.ā§Ļā§Ē.⧍ā§Ļā§§ā§Ļ
āĻ‰ā§ŽāϏāĻ°ā§āĻ—āσ āĻāĻ•āϟāĻŋ āĻ…āĻĻ⧃āĻļā§āϝ āĻĻ⧇āĻ“ā§ŸāĻžāϞ āĻāĻŦāĻ‚ āϤāĻžāϰ āĻĒā§āϰāϤāĻŋāĻĒāĻžāϞāĻ•āϕ⧇