NEWS: Low interest balance transfers canada credit cards Risperdal Lyrica Free online credit report no trial offer Diphenadione Sucralfate? Instant approval credit cards for people with high balances Personal credit report Instant approval gold credit cards Fosfomycin Fair credit report act Free credit bureau report? Debt consolidation service Accutane Buclizine Instant approval starter credit cards? Uk credit report Imipramine: Avelox 0 apr on balance transfer credit cards Zero interest balance transfer credit cards life Zalcitabine Best intoductory apr credit cards Instant approval on major credit cards Fair credit reporting act fcra A credit report. Into Make Mp Ringtones Samsung Nextel Ringtones Maker Etoposide Online instantly credit report Free credit rating report Lotrel Child life insurance Nialamide Phenelzine Chlorotrianisene Micronase Tyropanoate Compare balance transfer credit cards Vytorin Trimethadione Flovent Thyroglobulin Tolazamide Credit report companies Free credit report with no credit card. Credit cards with instant approval to help rebuild credit Mephenytoin Dapsone Credit reports with Zoloft Free instant credit report status Hyperalimentation Gentamicin Credit report information Niacin Credit cards 1.99 apr ny Free Mp Ringtones Accupril Instant online approval credit cards? Verizon Get It Now Ringtones Fosfomycin Minoxidil 0 balance transfer credit cards Free credit report check Mobile Ringtones Converter. Octreotide Free instant online credit report: And credit reports Nicoumalone Free Maker Nextel Ringtones Software Losec Get credit report Cipro! Understanding credit report score Check credit report experian: Credit reporting software Augmentin Order credit report Reading credit reports. Free Polyphonic Ringtones From Verizon Consumer credit reports! Pentoxifylline Canadian credit reports: Credit cards us instant approval Reporting bad credit Nonoxynol Cingular Mp3 Ringtones Loratadine Lg Ringtones V111 Verizon Wireless Free Mp3 Ringtones Samsung Debt settlement strategy Renter insurance usa Search high limit credit cards instant online approval: Get credit reports Free credit reports without using a credit card Diatrizoate Ringtones For Cingular Phone Renter insurance quote Report to credit bureaus, Chlorhexidine Metoclopramide! Tylenol Nolvadex Cricket Free Real Ringtones Credit cards instant approval first timers Butaperazine Nicoumalone. Real estate investing information free credit report score Diflucan Debt consolidation help Nortriptyline Credit report dispute Nialamide Cefamandole Reporting credit card Free credit report canada Pediacare! Cosopt Low interest balance transfers canada credit cards Annual credit report .com Streptomycin: Download Verizon Ringtones Off my credit report Ethopropazine Hydralazine Free Phone Ringtones Samsung Sprint Free online credit report canada: Methdilazine Compare credit cards balance transfer Pilocarpine Methylphenidate Isopropamide Donepezil Check credit report fix Acyclovir Credit report agencies Instant approval and credit cards Instant approval on credit cards Credit report at no cost Download Polyphonic Ringtones Free Samsung X427 Ringtones: Report to credit bureau Mexiletine Credit report at no cost Credit report companies Zero interest balance transfer credit cards Methoxsalen Online credit reports Interest balance transfer credit cards! Gemfibrozil Renter insurance quote Lowest apr rates on credit cards Flutamide: Nextel Real Music Ringtones Echothiophate: Cefdinir Free Ringtones For Verizon Wireless User, Summary of your rights under the fair credit reporting Cell Phone Ringtones Wallpaper. Instant approval credit cards for students Chlorcyclizine Commercial credit reports Cyclizine: Instant approval corporate credit cards Free Real Ringtones For Boost Mobile. Instant approval department stores credit cards Instant online pre approval credit cards Colistimethate Methixene Prednisone Menadione Coumarin Report to credit bureau? Free Verizon Lg Mp3 Ringtones Lamivudine Seroquel Trovafloxacin! Free credit report equifax Actos, My credit report Ceftriaxone 3 in 1 credit report Card consumer counseling credit report, Free Polyphonic Ringtones Samsung Vicodin Miglitol Company credit reports Secobarbital Restoril. Free Pcs Ringtones Sanyo Sprint Desipramine Refinance auto loan Cingular Mp3 Ringtones Codeine Diphenadione Moexipril Norepinephrine Paregoric Dilantin Iproniazid Cephradine Free Real Ringtones For Boost Mobile Report free credit card required instant online Mitoxantrone Best credit cards for balance transfer, Clorazepate Isopropamide Minocycline Humulin. Amaryl Converter Joy Ringtones Serial Eprosartan Instant approval students credit cards? Thalidomide Ringtones Converter Free Ware Ibuprofen No balance transfer fee credit cards Dexfenfluramine Check credit report identity theft Download Verizon Ringtones Cytarabine Card consumer counseling credit report Depakote 3g Cell Free Free Phone Ringtones Demeclocycline Credit cards interest free balance transfer rates Free credit report from trw Card consumer counseling credit report Estrace Differin Phenazocine. Fair credit instant approval gas cards How to obtain free credit reports Your credit report Free goverment credit report Free Verizon Ringtones Combivent Free personal credit report Nolvadex Fixing credit reports Download Free Hindi Ringtones Ganciclovir 0 apr on balance transfer credit cards? Dovonex Tobramycin Free government credit report Check credit report Ringtones For Cingular Phone Free 3 bureau credit report Actos Secured credit cards low apr credit card balance transfer Idarubicin Ceftizoxime Dofetilide College student credit cards with instant approval! Alavert Moexipril Bad credit report repair Piroxicam: Coreg Read credit reports How to obtain free credit reports Lithium Instant approval credit cards for people with bad Instant approval credit cards for people with high balances: Cyclophosphamide Equiafax credit reports Credit report information Obtaining personal credit report First usa zero percent balance transfer credit cards Clean your credit report Trileptal Obtain credit report Aminophylline Glucotrol Ramipril Employment credit reports Levlen Online credit report identity theft Acetophenazine Coumadin Credit report free Instant approval credit cards fair, Parnaparin Credit reporting bureaus Fentanyl Free Ringtones Samsung Sprint Iodamide Anisindione Fixed low apr credit cards Septra, Wav Ringtones Converter Instant online credit approval and credit cards. Credit reporting agencys Aspartame Free Cingular Cell Phone Ringtones Isoxsuprine Mirtazapine Free credit report without using a credit card Free credit report by law Piperidolate Cyclobenzaprine Three major credit reporting agencies Instant approval credit cards for Levorphanol Free Ringtones For Verizon Lg Vx3200 Phone Into Mp Ringtones Samsung Turn Propantheline Ativan Dexamethasone Downloadable Ringtones For Verizon Wireless Chlorthalidone Bleomycin Instant approval credit cards for bankruptcy histo Credit fix repair report Download Free Ringtones To Cellular Phone Sulindac: Piperacillin Depakote Darvocet Auto insurance Cheap credit reports Totally free online credit report Mephobarbital Casanthranol: Credit cards with 0 interest on balance transfers Download Ringtones For All Nokia Phone Anual credit report Maxis Caller Ringtones List Freecreditreports Zalcitabine Chloroquine Caller Download Hotlink Maxis Ringtones Free Alltel Ringtones Free Cingular Ringtones For Motorola Phone Clemastine Finasteride How to get a credit report Online dispute credit report Cancer insurance Fosamax Authorization and release credit report Credit report business Motorola Q Ringtones Zero percent credit cards balance transfer Free credit report no strings attached Midodrine Free I730 Nextel Ringtones Uk credit report Interest balance transfer credit cards Credit credit report no credit card needed Quinapril Premphase: Edrophonium Cyclopenthiazide: Instant approval major credit cards Dioxyline No interest ever balance transfer credit cards Codeine Busulfan Understanding credit report score Credit reporting industry Cordarone Instant approval for credit cards with poor credit Cash advance credit cards instant approval bad credit. Nonprofit debt consolidation Mp3 Ringtones Converter! Methantheline Credit cards no deposit bad credit instant approval: Credit reports on Credit reporting bureaus Up my credit report Methoxamine Experion credit reporting Instant approval credit cards! Annual credit reports Eprosartan Mobile Ringtones Converter Credit report letters: United states government personal credit report Robaxin: Amobarbital Enebrel Free equifax credit report Cyclothiazide Business credit card instant approval credit cards Ethoheptazine Ergotamine Lowest fixed apr credit cards? Somatostatin Doxylamine Tretinoin Insurance credit report! Methacycline Butaperazine Ecstasy Fleet zero percent balance transfer credit cards Strattera Pemoline Boost Free Nextel Ringtones Asparaginase Prinivil Chlorpromazine, Credit report in canada Estradiol Lactulose Mosquito Ringtones Silent Dicumarol Neurontin Guanethidine Epirubicin. Vinorelbine Cloxacillin Allegra Canada credit report Into Mp Ringtones Samsung Turn Gentamicin. Free Ringtones For Alltel Wireless Allstate fair credit reporting act litigation Pentoxifylline Instant approval bad credit cards in australia Download Mp3 Ringtones Converter Free Ringtones For Verizon Lg Vx3200 Phone. Cytarabine Credit cards online with instant approval: Foscarnet Omnicef Acarbose Credit report uk! Insulin About credit reports Canadian free credit report Cocaine Free Pcs Phone Ringtones Sprint Etretinate! Credit cards for establishing credit instant approval Credit report repair canada Oxyphenbutazone Instant approval 24500 00 credit cards? Us credit cards interest low apr 0 Free yearly credit report Listen Mosquito Ringtones Cosopt Fixed apr credit cards Butriptyline 025 apr balance transfer credit cards Instant guaranteed approval visa credit cards 3 credit report agencies Diltiazem: Ciclopirox Fixed interest balance transfer credit cards Seroquel Pentamidine! Credit cards with 0 interest on balance transfers Xanax Ambien Instant credit reports Relafen Ketorolac Canada instant approval credit cards Instant approval guaranteed credit cards? Credit report repair yourself Credit cards instant approval first timers Low interest apr credit cards Buclizine: Converter Pc Phone Ringtones Clofibrate Esomeprazole Toradol Instant online pre approval credit cards Download Free Phone Ringtones Fixed zero interest balance transfer credit cards Home construction loans. Online dispute credit report 025 interest balance transfer credit cards. How do i get a free credit report Cycrimine Lomotil Flurazepam: Glyburide Automobile title loans? Buspar Weaknesses of credit reporting Acetohexamide Sotalol. Beatles Hand Hold I Ringtones Wanna Allopurinol Credit history reports Quinidine: Instant approval online credit cards for bad credit Yearly free credit report Free no obligation credit reports Health insurance rates, Free Caller Ringtones Nutmeg Credit reports online Debt settlement Free Sprint Samsung Ringtones Renter insurance quote: Mobile Mobile Nextel Phone Ringtones T Esomeprazole Eulexin Free instant credit report online noe credit card needed? Lovastatin Chloramphenicol Best credit cards balance transfer Ergocalciferol Free Downloadable Ringtones Cingular Free Virgin Mobile Ringtones Oseltamivir Instant payday loans Apr balance transfer credit cards Read my credit report Check credit reports Auto insurance Obtaining credit reports Meclizine: Low cost health insurance Macrodantin A900 Ringtones Samsung Lotrimin Oxtriphylline Freeannualcreditreport.com Diethylpropion Ethinamate Zyban Mda Ringtones T Mobile Instant approval high limit credit cards Credit report pay by online check. Reporting to credit bureaus Ceftibuten Provera Avandia, Acetohexamide Cholestyramine? Tocainide Phenazopyridine. Federal credit report Clarinex! Hotlink Caller Ringtones Refinance Stay on my credit report Moricizine Low cost auto insurance Best credit cards instant approval Instant approval canadian credit cards Bumetanide Physostigmine Bad credit instant approval cards, Dichlorphenamide Free credit report act Diamox Refinance homes Annual report credit Glucophage 0 interest and no balance transfer fee credit cards Online instantly credit report? Hytrin Free Real Ringtones For Verizon Wireless Piperidolate Credit repair specialists Apr balance transfer credit cards Flosequinan? Restoril Verizon Wireless Lg Vx4500 Ringtones? Instant online pre approval bad credit cards Budesonide, Credit cards and instant approval How to read credit report? Home equity Free Ringtones Sanyo Sprint Dextroamphetamine Absolutely free credit reports, Sotalol Download Hear Mosquito Ringtones, Canadian credit score reports Lg Ringtones V111 Verizon Wireless Permax Ringtones For Alltel Cell Phone, Credit repair specialists Polyphonic Ringtones For Sony Ericsson Methamphetamine Student loan? Bad credit cards instant approval 3 in 1 credit reports Podofilox Fluvoxamine. Zero balance transfer credit cards Annual credit reports Ceforanide Dexchlorpheniramine 1 credit reports Aspirin Vincristine Atropine. Credit report pay by online check Balance transfer credit cards Free Maker Nextel Ringtones Software Cell Free Phone Ringtones Sprint Credit cards instant approval help rebuild credit Free Polyphonic Ringtones For Verizon Phone Dutasteride Free yearly credit reports Ringtones For Sprint Phone Iodamide: Ciclopirox Didrex Credit repair specialists Bacitracin Credit reporting Mazindol Bureau credit free report three Low interest balance transfer credit cards canadian Fix credit report Credit cards with low balance transfer rates, Free credit report online Samsung Polyphonic Ringtones Reviparin Free Mosquito Mp3 Ringtones Free on line credit report Fixing credit report? Listen Mosquito Ringtones Credit cards fixed apr

WordPress: Adding links to post categories

KarmaDude Feb 2, 2007 5 Comments

In WordPress 2.1, one of the features I was hoping for, with the new link categories, was the ability to add a link to a post category. Initially when I saw the new categories admin area, and the posts and links count columns, I assumed that it would be possible to add a link to the same category as a post.

For example: Let’s say I have a news category, and I want posts related to news and links to news sites to go into the same news category, rather than having a separate category news posts and news links.

Unfortunately, the category admin page in WordPress 2.1 is misleading. Even though, both link and post categories are stored in the same table, and are managed on the same page, the behavior is different. The way it works is, if you add a new category, and if the first item you add to the category is a link, then it becomes a link category, and if the first item you add is a post, then it becomes a post category. So if you go into the add link page, you will notice that the category list only displays the link categories and hides the post categories.

Now this behavior would be perfectly all right if you manage your links and posts as separate categories. But the way I do it in Counterjumper, posts and related links are usually assigned to the same category. A little digging around in the WordPress code, and it looks like this is an intentional behavior. The code can be found in return_link_categores_list() and return_categories_list() functions. These functions are in the admin-function.php file.

This is the SQL from return_link_categores_list function:

SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( category_count = 0 OR link_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY link_count DESC

If you notice after the AND the first condition checks for categories with no posts, the second condition checks for categories with one or more links, and the third condition checks for categories with neither links nor posts. So, basically this condition controls the categories to which you can assign lists:

- Categories with no posts, OR
- Categories with one or more links, OR
- Categories with no posts and no links

A similar logic is used for getting a list of categories to which you can assign posts.

Solution
Now in my case I needed an immediate solution, so I decided to take out the above three conditions from the SQL statement, and this allowed me to add links to any category. Here is the trimmed SQL:


SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY link_count DESC

I hope WordPress would remove this restriction on categories in the future, and allow it to be more flexible. As for the solution, it does change a core WordPress file, so I would not advise the use of this solution, unless you are comfortable changing things you should not be changing.

5 Comments

  • Mark Wegner
    Feb 17, 2007 | 12:28 pm

    Could you extend this logic to allow comments to be posted to categories as well? (Or /tag/ pages for those who use ultimate tag warrior). That would be wonderful to have.

  • KarmaDude
    Feb 17, 2007 | 2:24 pm

    Hmm, that’s an interesting idea. You could follow the same logic and create a comment2cat table, and associate comments to categories. Since WordPress does not currently do this, you will have to make some kind of a custom plugin to accomplish this.

  • TJ
    May 3, 2007 | 4:31 am

    Thanks for detailing this. I’ve just spent the best part of a morning trying to work out why 60 categories weren’t showing up when posting/editing.

    I hacked the code and found the same explanation as you.

    It makes no sense to me, definitely counter-intuitive and even illogical.

    There’s a bug report in Trac discussing this.

  • KarmaDude
    May 3, 2007 | 8:50 am

    @TJ, do you have the Trac link for this bug?

  • Wordpress Categories not &hellip
    Jun 19, 2007 | 4:07 am

    […] Wordpress installation by telling you how to actually FIX this problem. Instead, I’ll just point you in the right direction. In reality, this seems like a pretty simple thing to do. You just change an SQL query or two in a […]

Leave a Comment

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>