January 17, 20101 Comment

Today I will show how to play with wordpress permalink. If you are just working with a fresh wordpress installation then certainly you need to do some work with wordpress permalink structure. Just check in admin left menu Settings->Permalinks
Here is first look of your default permalink structure. Check your post and page url is like:
wpdefaultpermalink
Post: http://sitename.com/?p=N, where N = post id
Page: http://sitename.com/?page_id=N, where N = page id
Category: http://sitename.com/?cat=N , where N = category id
Tag: http://sitename.com/?tag=TAG SLUG, pls check bellow what is slug
Author:http://sitename.com/?author=N, where N = author id


Now, let’s change the permalink structure to any custom format… here I am choosing the Month and name format and see screenshot bellow
wpcustompermalink
Oh, check another thing before and after changing permalink structure,if you are in edit more of any post or page, check bellow the subject box
For default permalink: there is a option “Change permalinks”
For custom permalink: there is a option “Edit”
Check the screenshot bellow:

wpcustompermalink2

Please check here what we are editing or getting automatic after saving first time(or auto save) the post … is called slug for that article, we use article name alias for joomla same way. if seo enabled in joomla then that alias is used. Ok ,now check after changing permalink to any custom format what happened to all permalinks like posts, page, author, category, tags etc. Let’s check
Post and Page will get as the screenshot above (example http://localhost/blog/2010/01/playing-with-wordpress-permalinkslug-quick-seo/)

Category: http://localhost/blog/category/category slug/
Tag: http://localhost/blog/tag/tag slug/
Author: http://localhost/blog/author/author username(nick name) is here/

Check here for category,tag, author etc the bold part we are telling base like catgory base, tag base or author base. and the italic part is slug, Sometimes that base is also called slug for simplicity.

Making post link .html
If think you cheked some wordpress site has post link as .html … more like static and more friend for google .. I mean search engines. No worry, it’s just easy. Put a .html in the custom permalink format of your post.
Just write this in custom field
/%year%/%monthnum%/%postname%.html
and my current blog post url is now
http://localhost/blog/2010/01/playing-with-wordpress-permalinkslug-quick-seo.html
Making the url more short
I think now our url got too long and sometimes that is bad for serach engines. So while we write blog post we can keep the title long(not more than 160 may be… 160 length is good for search engines) but we will edit post or page slug as short as possible. That the trick … taking specially care as do for your girl friend or your baby.
Oh another way we can make the url short… let’s change the permalink again. Let change custom permalink as
/%postname%.html
and my post link is more short now
http://localhost/blog/playing-with-wordpress-permalinkslug-quick-seo.html
for news site we can use like this

/newid%post_id%/%postname%.html
now link is like

http://localhost/blog/newid160/playing-with-wordpress-permalinkslug-quick-seo.html


So I think we played too much with post permalink and now we know how to change the post permalink as we need. Isn’t it easy ?

Chaning page link to .html
There is no easy way to change page link .html like post from wordpress but we can do it via a plugin, acutally wordpress has that support to change permalink for page or others … so plugin authors can hack easily. To change page link like .html you can use this pluginCustom Page Extensions

Working with Category,Tag and Author base
Let’s play with category and tag base that is available in wp permalink.

categorytagbase
So now tag link be like
http://localhost/blog/postbytag/tag slug
Category link
http://localhost/blog/topics/category slug

Hei we are not finished yet. How about removing category base from category permalink ?
let me explain if you don’t change category base that means default is “category” then
http://sitename.com/category/category slug
and for child cateogory
http://sitename.com/category/parent category slug/child category slug

and now what I want to do is like bellow

http://sitename.com/category slug
http://sitename.com/child category slug

Yes we can do that I mean remove category base using plugin. I like to use No category parents. I have tested in a client’s site and it’s working fine.

Yap we can change author slig(base actually) too ,,, not remove, just change default author base “author” to any custom word like “blogger”, “contributors” etc.

Old: http://www.sitename.com/author/manchupagla/
New: http://www.sitename.com/contributors/manchupagla/

For this so many wordpress plugins are available. But I like to use Author Slug, in codex check here. You can search codex for such plugins.

Heh heh talked too much today. I will recommend you to use another two plugins

Note: Check this post in bengali in amaderprojukti forum from here.

thank you for having patience to read this blog. Don’t forget to click share in social network and I like donation(check right col donation box :D )

December 29, 20091 Comment

Hello! 2010 is just knocking at door :D .Hope to write lots of blog with my day2day thinking, learning and the problems I face every day.

Let me clear about this blog post: I think, you know that in wordpress we can add new coasdl in posts listing area. Check the bellow image of my post edit panel/listing(http://(yoursitename)/wp-admin/edit.php)

editpanel1 Fix wordpress plugin GT post approval

If you check the plugin there is an extra col named GT Status. It’s here because I have installed the plugin GT-post-approval. Check this in wordpress plugin repository from here. Cool na ? Let me show another screenshot after enabling another nice plugin named “Simply Show IDs”. Check that plugin wordpress plugin repository from here. This plugin will add another extra col to show any post id so that we(at least normal blog user who doesn’t know how to pick post id) can pick post id easily. Actually this plugin does

“Simply shows the ID of Posts, Pages, Media, Links, Categories, Tags and Users in the admin tables for easy access. Very lightweight.”

editpanel2 Fix wordpress plugin GT post approvalCheck there are two extra col now.. ignore the blug arrow and messed up id with text “Reject”. Let me now explain why this messed up…
…continue reading Fix wordpress plugin “GT post approval”

December 25, 2009Leave a Comment

Post and Page Excerpt Widgets is a nice plugin to show post/page excerpt as as widget in sidebar position. You can download it from wp code from here. One I thing I noticed about this plugin is it has a common bug that I faced many times while using query_posts. When I use this query_posts it’s break some conditional loop like is_home(), is_category() etc but there is another function get_posts in wordpress that does the same thing but don’t have similar problem. Once I discussed about this problem in one of my old posts. Please check that posts for better sense from here is_home-is_single-is_category-is-not-working-in-wp!.

Let me focus to this writing again :D
As Post and Page Excerpt Widgets is using the query_posts function for custom query it make’s problem for conditional tags. Let me show u solution and it’s like my that posts.
In you theme functions.php add a new function if not exists yet

 function php4_clone($object) {
  	if (version_compare(phpversion(), '5.0') < 0) {
   		return $object;
  	} else {
   		return @clone($object);
  	}
 }

…continue reading Fix wp plugin “Post and Page Excerpt Widgets” not to break conditional tag

December 2, 200922 Comments

Update 14, January, 2010
WOW, This extension has been approved by JED Team. Pls visit it and place you rating.
tab Home made tab and slider module for joomla1.5If you check joomla1.5.x backend(joomla1.x had same) in any component or module configuration the right col accordian slider is common. In some components u should see tab too.To make such tab and slider is just so easy !

I think you are thinking about my post title, why I used the words “home made”. Because I am going to show you how u can make such a tab/slider module for front end just using joomla own resource. Joomla gives some execillent api to make html grid, tab, slider etc within a moment. JPane is such an api to make tab and slider. Here you will get some code example about how to make tab using JPane.
…continue reading Home made tab and slider module for joomla1.5

November 8, 2009Leave a Comment

wpsecuritythumb Send ajax request in wordpress using wpnoncelet’s send ajax request in wordpress using wpnonce

Hei, I am not going to discuss what is wpnonce and why you should use this in your plugin or how important to use this to secure your plugin :P
But here I am going to discuss how you can use wpnonce in ajax request, I mean if your plugin handles ajax request.
Steps that we need to follow are:

One: Create wpnonce value.
Two: Send wpnonce value as an extra parameter with ajax requestion
Three: Check ajax referrer with the wpnonce value that was created in step one and sent in step two.

Ok, how to create a wpnonce value ?
we need to use wordpress function wp_create_nonce() . See wordpress codex here.
< ?php $my_wpnonce= wp_create_nonce (‘you-look-nice’); ?> // “you-look-nice” is just a string, u can use whatever u want. here $my_wpnonce will get a hash from wp_create_nonce. Oh that is not direct hash of “you-look-nice” but based on user id, time and that string. To know more about this function please check pluggable.php in wp-includes folder

Now send wpnonce value $my_wpnonce as an extra parameter while seding ajax req. …continue reading Send ajax request in wordpress using wpnonce

October 26, 20093 Comments

newsticker 300x125 RSS news ticker using jquery and Slick RSS module in joomlaLet me clear first about what is Slick RSS

Slick RSS is a joomla module that Parse and Display RSS Feed News with DHTML Teaser Tooltip. For details pls visit this link.

ok , let me tell what I am going to do next. That module is great to show rss feed from another site and I want to use it as a news ticker and it can be named as rss news ticker. ok then let’s make it done.

I am going to use js library jQuery and it’s plugin BBCNewsTicker. Please download latest version of jquery and that plugin this the given link.

Now, install the module Slick RSS in your joomla site and publish in any module position. Now I am going to make little change in the module code so that it can be configured for newsticker.

open the file default.php from modules\mod_slick_rss\tmpl and check link near 39

…continue reading RSS news ticker using jquery and Slick RSS module in joomla

অক্টোবর ২, ২০০৯5 টি মন্তব্য

আমি ব্যক্তিগত ভাবে যা করি যখন জুমলার জন্য কোন নতুন টেমপ্লেট বানায় তখন ডিফল্ট টেমপ্লেট rhuk_milkyway কপি করে নতুন নাম দিয়ে অপ্রয়োজনীয় ছবি, সিএসএস কোড ইত্যাদি সব মুছে ফেলি। এরপর নিজের মতো করে কোড করি সব কিছু। একথা বলার কারণ এইটা যে আমরা যদি ডিফল্ট টেমপ্লেট ব্যবহার করি তাহলে একটা ফাইলে সামান্য কিছু কোড যুক্ত করেই পেজিনেশনের ডিজিটগুলো বাংলা করে ফেলতে পারি।

এখন দেখি কি করে করা যায়। যদি ভালো করে খেয়াল করেন তাহলে নিশ্চয় templates\rhuk_milkyway\html এই ডিরেক্টরীতে pagination.php নামে একটা ফাইল আছে। এই ফাইলটা প্রথমে utf-8 হিসাবে সংরক্ষণ(save) করুন। এরপর
ফাইলের একদম শেষে ?> এর আগে নিচের কোড কপি পেস্ট করুন। …continue reading জুমলার ডিফল্ট টেমপ্লেটে পেজিনেশনে ডিজিট কিভাবে বাংলা করবেন ?

সেপ্টেম্বর ১৭, ২০০৯১টি মন্তব্য

যারা এই সিরিজের আগের দুইটা পোস্ট পড়েননি তাদের জন্যঃ
ওয়ার্ড প্রেস টিপ্স-১(আমার ব্যক্তিগত ব্লগে)
ওয়ার্ড প্রেস টিপ্স-২(আমার ব্যক্তিগত ব্লগে)

ওকে তাহলে আজকের টিপ্স শুরু করা যাক। এর আগে লিখেছিলাম কিভাবে ওয়ার্ডপ্রেস কাস্টম পেজ তৈরি করা যায় যা ছিলো কাস্টম টেমপ্লেট ব্যবহার করে। কিন্তু একত্রে যা হয় পাতাটা ওয়ার্ড প্রেসের ডাটাবেজ থেকে আসে, মানে পাতার কন্টেন্ট। কিন্তু যদি এমন চাই যে একটা স্ট্যাটিক পাতা হবে কিন্তু ওয়ার্ড প্রেসের ভেতরে থেকে এবং ঐ পাতায় ওয়ার্ড প্রেসের যাবতীয় টেমপ্লেট ট্যাগ ব্যবহার করা যাবে। ধরুন আপনি ওয়ার্ড প্রেস ইনস্টলেশনের রুট ডিরেক্টরীতে একটা ফোল্ডার বানালেন যার নাম myfolder. তাহলে এই ডিরেক্টরীর লিঙ্ক হবে http://yoursite.com/myfolder দেখুন এটা কিন্তু ওয়ার্ড প্রেসের ফোল্ডার নয়।
এখন এই ফোল্ডারে একটা php ফাইলে তৈরি করুন। ধরুন myfile.php।
ফাইলের শুরুতেই লিখুন এই রকমঃ

< ?php
	define('WP_USE_THEMES', false);
	require( dirname(__FILE__) .'/../wp-blog-header.php');
?>

যদি myfile.php একদম রুটে রাখেন তাহলে

< ?php
	define('WP_USE_THEMES', false);
	require( dirname(__FILE__) .'/wp-blog-header.php');
?>

…continue reading ওয়ার্ড প্রেস টিপ্স-৩

সেপ্টেম্বর ৬, ২০০৯3 টি মন্তব্য

গতকাল ওয়ার্ড প্রেস নিয়ে লিখেছিলাম এই টপিকে এবং আমার ব্লগে এখানে। আজকে আবার নতুন কিছু নিয়ে লিখবো ,সাথে সাথে গতকালের ধারবাহিকতা চলবে। আমরা এই সিরিজের মূল উদ্দেশ্য ওয়ার্ড প্রেসের নরমাল ইউজার থেকে শুরু করা ওয়ার্ড প্রেস বেসড ওয়েব ডেভেলপার সবার জন্য আমার জানা ট্রিক্স ও তথ্যগুলো শেয়ার করাঃ
তিনঃ ‘থীমে সাব থীম ফাইল যুক্ত করা’

আগের দিন বলেছিলাম কিভাবে নতুন হেডার ফাইল যুক্ত করা যায়। চাইলে নিচের মতো করেও আমরা নতুন ফাইল থীমের যে কোন জায়গায় যুক্ত করতে পারি। কারণ একই ফাইলে অনেক কিছু লিখলে ট্রাক রাখা সমস্যা হয়।

< ?php include (TEMPLATEPATH . '/yourfilename.php'); ?>

yourfilename.php নামের ফাইলটি আপনার বর্তমান এক্টিভ বা যে থীম নিয়ে কাজ করছেন তার ভেতর রাখুন। আর অন্য থীম ফাইলের যেখানে দরকার সেখানে ব্যবহার করুন। TEMPLATEPATH আপনার বর্তমান থীমের ডিরেক্টরী। প্রশ্ন করতে পারেন এমন ঝামেলা কেন করবো বা এটার সুবিধা কি তাই তো ? হুম… ওয়ার্ড প্রেস দিয়েই আপনি চাইলে জুমলার মতো সাইটে বানিয়ে ফেলতে পারেন। জুমলাতে আমরা মডুল প্লেস হিসাবে যা বলে থাকি ওয়ার্ড প্রেসে তাকে বলা হয় সাইডবার(sidebar) আর মডুল গুলোকে ওয়ার্ড প্রেসের ভাষায়(বলা যেতে পারে) উইজেস(widget). আপনি চাইলে ওয়ার্ড প্রেসে যত ইচ্ছা সাইড বার ব্যবহার করতে পারেন তবে আপনার থীমে সেই সাপোর্ট থাকতে হবে। এই বিষয়টা নিয়ে পরের পোস্টে লিখি তাহলে।

চারঃ ‘ওয়ার্ড প্রেসে যত ইচ্ছা সাইড বার যুক্ত করা’

প্রথমেই বলে রাখি নতুন কিছু জানার আগ্রহ না থাকলে বা এক্সপেরিমেন্ট করার ইচ্ছা না থাকলে এখনই মানে মানে কেটে পড়তে পারেন না হলে পরে পস্তাবেন। :ttt:

‘তিন’ নং টিপ্সের কিছু বলা দরকার। ওয়ার্ডপ্রেসে আমরা নিচের কোড টুকু দিয়ে সাইডবার ফাইলটি লোড করি।

< ?php get_sidebar(); ?>

এটা যা করে তা হলো থীমের ভেতর sidebar.php ফাইলটা include করে। এখন যদি আপনার বিশেষ পাতায় বিশেষ কোড লেখা সাইড বার দরকার হয় তাহলে কি করবেন সেটা যদি এখনও না ভেবে থাকেন তাহলে আপনার উপর আমি এখনি কিন্তু খেপে গেছি। >:D< হ্যাঁ সেই আগের ট্রিক্স এখন যে সাইড বার ফাইলটা আছে সেটা কপি করে নতুন ফাইলে হিসাবে সেইভ করুন আর নাম দিন আগের সেই ফরম্যাটে যেমন sidebar-mycustomsidebar.php আর এই ফাইলে নিজের ইচ্ছা মতো পরিবর্তন করুন। আর এটা লোড করুন এই ভাবে

<?php get_sidebar('mycustomsidebar'); ?>

। মজা ?

…continue reading ওয়ার্ড প্রেস টিপ্স২

সেপ্টেম্বর ৫, ২০০৯8 টি মন্তব্য

“ওয়ার্ড প্রেস টিপ্স” এ ধারাবাহিক ভাবে ওয়ার্ড প্রেস বিষয়ক ছোট ছোট তথ্য দেওয়ার চেস্টা করবো।
নোটঃ কিছু কিছু টিপ্স এডভান্সড লেভেলের হতে পারে যা প্রফেশনাল ওয়ার্ড প্রেস বেসড ওয়েব ডেভেলপারদের জন্য কাজে দিবে আশা করি।

একঃ কাস্টম হেডার ফাইল বা header.php ফাইল কোন পাতায় যুক্ত করাঃ
সাধারণত আমরা এমন ভাবে থীম বানায় যে সাইট যেন হেডার, বডি, ফুটার এই ভাবে থাকে। আর এই চিন্তা থেকেই ওয়ার্ড প্রেস থীম এর কোর ফাইল হিসাবে header.php , footer.php ফাইল দুইটা থাকে। আর header.php ফাইল যুক্ত করার জন্য index.php, category.php ইত্যাদি ফাইলে আমরা ওয়ার্ড প্রেসের একটা টেমপ্লেট ফাংশন লিখিঃ

< ?php get_header(); ?>

যা header.php ফাইলটা লোড করে
এবং একই ভাবে footer.php ফাইলে যুক্ত করার জন্য লিখি এই রকমঃ …continue reading ওয়ার্ড প্রেস টিপ্স-১

feedback