“ওয়ার্ড প্রেস টিপ্স” এ ধারাবাহিক ভাবে ওয়ার্ড প্রেস বিষয়ক ছোট ছোট তথ্য দেওয়ার চেস্টা করবো।
নোটঃ কিছু কিছু টিপ্স এডভান্সড লেভেলের হতে পারে যা প্রফেশনাল ওয়ার্ড প্রেস বেসড ওয়েব ডেভেলপারদের জন্য কাজে দিবে আশা করি।
একঃ কাস্টম হেডার ফাইল বা header.php ফাইল কোন পাতায় যুক্ত করাঃ
সাধারণত আমরা এমন ভাবে থীম বানায় যে সাইট যেন হেডার, বডি, ফুটার এই ভাবে থাকে। আর এই চিন্তা থেকেই ওয়ার্ড প্রেস থীম এর কোর ফাইল হিসাবে header.php , footer.php ফাইল দুইটা থাকে। আর header.php ফাইল যুক্ত করার জন্য index.php, category.php ইত্যাদি ফাইলে আমরা ওয়ার্ড প্রেসের একটা টেমপ্লেট ফাংশন লিখিঃ
< ?php get_header(); ?>
যা header.php ফাইলটা লোড করে
এবং একই ভাবে footer.php ফাইলে যুক্ত করার জন্য লিখি এই রকমঃ
< ?php get_footer(); ?>
যা footer.php ফাইলটা লোড করে
আর এই কারণে দেখা যায় সব পেজে হেডার আর ফুটার অংশ একই থাকে। এখন যদি এমন হয় কোন কাস্টম টেমপ্লেট পাতায়(এটা যদি কেউ না বুঝেন তাহলে পরের টিপ্স মানে ‘দুই’ দেখুন আগে) যদি হেডার বা ফুটার আলাদা দেখাতে চায় তাহলে দুইটা উপায় আছে এক header.php ফাইলে নিচের মতো কন্ডিশন যুক্ত করতে হবেঃ
if(is_page(page id here)){
//write your specific code for the specific page id
}
কিন্তু যদি এতো ঝামেলায় না যেতে চায় তাহলে অন্য উপায় আছে তাই এই রকম।
header.php টা কপি করে header-myheader.php এই রকম নামের ফরম্যাটে সেইভ করবেন। এখানে আপনি আপনার ইচ্চা মতো myheader এই টুকু দিবেন। যেমন ধরুন আপনি গ্যালাই একটা আলাদা পাতা তৈরি করছেন। তাহলে ঐ পাতায় জন্য আলাদা হেডার ফাইলের নাম দিতে পারেন header-gallery.php । এরপর এই নতুন ফাইলে আপনি ইচ্ছা মতো সম্পাদনা করুন বুঝে বুঝে যা শুধু গ্যালারী পাতার হেডার হিসাবে দেখাবে। ভাবছেন এটা কিভাবে থীমে যুক্ত করবো ? হুম এই ভাবে… যদি আপনার হেডার ফাইলের নাম header-myheader.php এটা হয়
< ?php get_header('myheader'); ?>
ফুটার এর জন্যও ব্যাপারটা একই রকম।
দুইঃ নিশ্চয় মনে আছে ‘এক’ উল্লেখ করেছি কিভাবে ওয়ার্ড প্রেসে কাস্টম পেজ এর টেমপ্লেট যুক্ত করা যায়। আপনি যখন ওয়ার্ড প্রেস থেকে নতুন পাতা(new page , not new post ) তৈরি করেন দেখবেন ডান দিকে একটা অপশন আছে Attributes এবং তার ভেতর Templates . এখানে সব সময় Default template সিলেক্ট অবস্থায় থাকে। যদি আপনার থীমে কাস্টম টেমপ্লেট ফাইলে থাকে তাহকে লিস্টে থাকবে। ধরুন page.php ফাইলটা রিনেম করে নাম দিলেন myfile.php আর এই ফাইলে নিজের মতো করে কিছু কোড দিলেন। এখন ফাইলের ভেতর শুরুতে লিখে দিন
< ?php /* Template Name: My Template */ ?>
এখানে My Template বা যা নাম(এখানে ফাইল নেম আর টেমপ্লেট নেম একই হতে এমন নয়) দিবেন টেমপ্লেটের সেইটাই নতুন পাতা তৈরি বা সম্পাদনা করতে গেলে ডান দিকে Attributes এ Template লিস্টে দেখাবে।
নোটঃ অনেক সময় দেখা যায় একটা কাস্টম পেজ আগে কাজ করতো কিন্তু হঠাৎ করে আর কাজ করছে না এবং কারণও বুঝতে পারছেন না। আপনি সঠিক ভাবেই Template লিস্ট থেকে সিলেক্ট করেছেন সেক্ষেত্রে টেমপ্লেট ফাইলটাতে টেমপ্লেট নাম পরিবর্তন করে নতুন কিছু দিন।
পরের দিন নতুন কিছু…
One of my senior brother just asked me, how to add no follow rel for comments in wordpress. May be there is plugin for this. Look to my code 
Time.com clone (look and feel) using wordpress: Though time.com changes their layout frequently, I made a clone of it’s interface using wordpress, I mean the theme of wordpress. Here is snapshot of that. Oh yes, at first I made it red as time.com and then changed the red color to greenish. It’s for 
secondbilly.com clone of mobile.de: A german site for furniture market. It’s using joomla and market place component , though it’s customized too much. The main marketplace component is customized as needed and some custom modules are developed to give support to the component in front end. It’s in german language
Now a days I am a great fan of wordpress. Recently I have done some projects on wordpress and getting expert day by day 

A poor or faster way to add wptinybn support to wp TinyMCEComments plugin
I have a wp plugin named wptinybn which enables users to write in unicode bangla for different types of bengali keyboard in wp visual editor which is based on tinymce. Actually my wp plugin is based on my tinymce plugin tinybn. That means besides the wptinybn the tinybn plugin is a standalone tinymce plugin. So it should work with everywhere with tinymce. ok.. I am 25% done
There is another wp plugin named TinyMCEComments which enables wp users to write comments through tinymce editor. I am 50% done. Cool na ?
One of my reader asked me how to add the tinybn support to TinyMCEComments. I just check that plugin’s code and I have that plugin installed in my own blog too though not enabled! Yes my answer is yes … that means it’s possible. It can be done in different ways. As a quick thinking I am giving a poor or faster (whatever u think) way to do that. I am 75% done… wait a bit man.
Download the wptinybn and TinyMCEComments plugin and install them. (if u want not to install wptinybn to do that then it’s ok, I mean no dependency). Check wptinybn(unzip first!) folder and you should find a folder in it named “banglafkb”.Copy this and paste in wp-includes/js/tinymce/plugins folders in your blog wp installation. Done ? ok now …
hmm now you have to be more brave to edit the TinyMCEComments plugin… not much in deed. Open file tinyMCEComments.php and find the word “pls”. Stop to it’s first occurance the word will be like $pls and it’s a array and here parts of code is like
$pls = array('separator','bold','italic','underline','strikethrough','justifyleft','justifycenter','justifyright','justifyfull','bullist','numlist','outdent','indent','cut','copy','paste','undo','redo','link','unlink','cleanup','help','code','hr','removeformat','sub','sup','forecolor','backcolor','charmap','visualaid','blockquote','spellchecker','fullscreen');now place // before this line and it will be like bellow
//$pls = array('separator','bold','italic','underline','strikethrough','justifyleft','justifycenter','justifyright','justifyfull','bullist','numlist','outdent','indent','cut','copy','paste','undo','redo','link','unlink','cleanup','help','code','hr','removeformat','sub','sup','forecolor','backcolor','charmap','visualaid','blockquote','spellchecker','fullscreen');we just kept the old code .
now in new line put this bellow code
$pls = array('separator','bold','italic','underline','strikethrough','justifyleft','justifycenter','justifyright','justifyfull','bullist','numlist','outdent','indent','cut','copy','paste','undo','redo','link','unlink','cleanup','help','code','hr','removeformat','sub','sup','forecolor','backcolor','charmap','visualaid','blockquote','spellchecker','fullscreen','banglafkb');If you check the above code what I have added new here ? just that ,’banglafkb’
I am 90% done. Now to to your admin panel activate tinymcecomments plugin then from menu Settings go to it’s(that plugin’s) setting page and check (if you done above copy pase and code editing) ‘banglafkb’ is in the button list and in the available plugin list. Just click both banglafkb to add from button list and plugin list. For button list click seperator before banglafkb that will be make a | seperator in editor. Now save this new option and check your comment form.
Angry one me ? You have done every thing properly but nothing new in the editor and u don’t see any change in the preview editor int the plugin options page. Don’t worry. The plugin keeps the setting in cache for 10 days. So to get the changes within one sec just open the tinyMCEComments.php file and pls check from top few liens code
there is a line like
$mcecomment_expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
make this line comment I mean like
//$mcecomment_expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
and now put a new line bellow it like
$mcecomment_expiresOffset = 1; // Cache for 1 sec in browser cache
now save this file and check the option’s page’s preview editor.
I think I am 100% done now. mu ha ha.
Oh I forgot to say currently I am working on a joomla plugin to make the dates in bangla for front end for articles, actually it will work with com_content …hope to release this on the eid-durga puja vacation.
Again here is some screenshot(one is above) of this post’s summary.


Tags: tinymcecomments, wordpres plugin, wordpress, wptinybn
Category: wordpress, wordpress plugin