發佈時,我希望用戶只能選擇一個類別。我怎樣才能達到這樣的目標?在wordpress中,如何限制帖子僅限於類別?
對不起,我應該更清楚。當選中這些框來選擇帖子將要進入的類別時,我希望它能夠作爲單選按鈕,您只能選擇一個選項。
jQuery的將是一個速戰速決,發現下面的代碼jQuery的在線和我試圖找出其中將它添加到post.php中head標籤:
var $t = jQuery.noConflict();
$t(document).ready(function() {
$t('#categorychecklist li input[type="checkbox"]').each(function(){
$t(this).change(function(){
//alert($t('#categorychecklist li input[checked="checked"]').parent().html());
$t('#categorychecklist li input').attr('checked','');
$t(this).attr('checked','checked');
})
})
});
你會需要更多的信息,如果你想一個答案。 –
我的意思是我想限制用戶只有一個類別(紅色小部件或藍色小部件,而不是兩者)。我不知道從哪裏開始。也許我可以得到幾個指針... – Cris
花了45秒找到這個:http://wordpress.org/extend/plugins/members-category/ –