Blog

WordPress Widget: King Categories

wordPres Widget King CategoriesFirst off i must say that the wordpress widgets plugin deeply impressed me. In fact, half an hour after MP:Ole pointed me to it, i had my first widget written.

Widgets will revolutionize the way normal users can interact with wordpress.

Therefore i wanted to write a plugin for one of the most used  (and at least by me, most hated) wordpress template placeholder … the list_cats() It´s used for the category listing in the sidebar or somewhere else in your Website.
This function has a big ass eighteen Variables long parameter list, which let me struggle again and again. Also because there are big differences between setting a var to "false" or "0" (nicely mixed up in template-functions-category.php Line: 277 ).
I always ended up in an hour of trial and error until i had my custom category navigation build.

Anyway this WordPress Widget will hopefully wipe away your fear of the list categories function and makes it easy to screw around in the category navigation.

Features / Changelog 

Version 0.93

– BUG when selected show only in xy Category widget would show everywhere (thanks Klaus)

 

Version 0.92

– NEW Remote Version check

- NEW Complete "Where To Show" Options. With the new option to have a comma seperated list of siteArea´s (single Pages/ID/Slugs) where to show

- NEW copy Options from another category widget
– NEW Options dumper
 

Version 0.85

- small fixes to ensure compatibility with new framework structure
– nicer JS Menu using moofx (framework improvement)
– Help Titles are now shown only in widget area (framework improvement)
– changed widget admin title back to "King Cat xy" because with my widget title hack you need the place to show the real title

Version 0.8

- Enhanced JS Navigation for Widget Options. It now fits better on small Monitors and does not overwelm you that much :-)

- Option to use the Fold Category Navigation if installed

- Bugfix in Setting of Default Option

- renamed widget header to "King Category Menu xx" 

- Moved Framework into new Folder ->plugins/king-includes/ 

- moved Admin Head includes into framework 

Known Issues:

- The JS Accordeon Admin Menu is now closing the right way if multiple instances of the widget are used. But not in IE..the settings are not influenced by this! Read more in the Framework Article.

Maybe some JavaScript Pro can assist me with that … Help!

————– 

Version 0.71

- MULTIPLE Category Menu´s

- 4 HTML fields to customize before/after Widget and Title 

- Option to insert default category menu options 

- enhanced underlying Framework (If you don´t want to change the engine .. no need to look under the hood) 

Version 0.6 

- 15 Option fields to set all Category List options – list_cats() in Admin Widget Area resulting in a fully customizable Category menu without coding.

- option for debugging output in Frontend

- js help tooltips

- full gettext translation currently available languages: German / English

Screenshots

Version 0.8 Widget Admin Area with new AJAX Foldable Menu (this has slightly changed with version 0.85 and look a bit nicer..screens will follow )

 

King Category Admin Screen Ajax Menu

 

 Version 0.7  English and German Admin Screen.Please Klick to enlarge.

 King Category Admin Screen WordPressKing Category Admin Screen WordPress

Multiple WordPress category Menu

 Comming Features

- Option to show a Category menu only under a given Category. Very usefull if you have deeply nested Categories… if you need this urgendly write me because it´s nearly finished

- copy Options from another category widget

- Options dumper

- option to toggle help titles on/off because they apply to every label elemet in admin area or maybe different implementation method (Ajax)

- fold the admin menu to group the options into smaller sets because the popup is kinda big right now on small monitors and might be confusing for beginners 

- Foldable category list 

- more than one Category Navigation like text or rss widget fields

- before and after fields for layout can be set in Admin Area

 

Install 

Of course you should have wordpress widgets installed and activated. If not, you can find the download and install instructions over at automattic.com

- Copy king_categories.php into your plugins widget folder -> where your widgets.php is !!!

- Copy king-includes (the widget Framework) into plugins 

- activate in Pluginarea.

- Drag the King Categories Widget on one of your sidebars and play with the options. In the Advanced Options Tab you´ll find a switch for inserting WordPress Defaults to get a Start.

Update 

- Copy king_categories.php over your existing File.

- Since the Framework was moved you should delete the existing king-includes folder and copy the new king-includes into the /plugins Rootfolder

- The name of the Widget has changed (again sorry) so you need to drop it again onto your sidebar

Download

 


Version 0.93

king-categories_0.93.zip king-categories_0.93.zip (05.09.2006 09:47)

 

Version 0.92

 - needs the King Widget framework  from version 0.70 and up

king-categories_0.92.zip king-categories_0.92.zip (03.09.2006 14:50)

 

Version 0.85 

 - the King Widget framework is now keept seperate, make sure you get it too

king-categories_0.85.zip king-categories_0.85.zip (07.05.2006 03:35)

 

Old Versions

Version 0.8

-  including king-includes (the widget framework) svn Version 102
– german mo and po files 

king_categories_0.8.zip king_categories_0.8.zip (23.04.2006 19:38)

 

Version 0.71

– including german po and mo files
– including king widget framework in king_widgets_inc

king_categories_0.7.zip king_categories_0.7.zip (15.04.2006 15:34)

Please don´t hesitate to give me a feedback if this is usefull or if you think you found a bug!

Have fun! 

Georg Leciejewski

101 Comments to WordPress Widget: King Categories

  1. 21.09.2006 at 17:43

    Bah! I’m so close… but the “Children of” feature isn’t working. I get the children AND all of the top-level categories, including the “empty” parent category of the children I’m trying to show (“Review”).

    Help?

  2. 16.09.2006 at 7:22

    I can’t seem to find my widgets.php. Please help

  3. 06.09.2006 at 0:06

    Hallo Schorsch,

    das King-Kategorie Plugin klappt soweit jetzt wunderbar, das einzige was es noch perfekter machen wuerde, wenn die Oberkategorien die Anzahl der Beitraege in den dazugehoerigen Unterkategorien zusammenzaehlen wuerden. Z.B. Auf meiner Seite die Kategorie “Gallery” (0 Beitraege) hat eine Unterkategorie “00er” (0 Beitraege) und diese hat unter anderem die Unterkategorie “’06″ (2 Beitraege) es waere super, wenn die Ueberkategorien “00er” und “Gallery” auch eine 2 in der Beitraganzahl dahinter anzeigen wuerde anstatt einer 0. Also sprich die Unterkategorien zusammenzaehlt.

    Ich hoffe du konntest mir folgen

    Danke

    Alex

  4. Klaus's Gravatar Klaus
    05.09.2006 at 23:38

    Kann es sein wir reden da von zwei verschiedenen Dingen. Du schreibst +30,9. Feld Bezeichung Category ID. An dieser Stelle läßt sich aber nur eine ganzzahlige Ziffer max 3 Stellen eintragen !
    Es handelt sich um das erste Eingabefeld von oben, NICHT um das ganz unten.
    Also Feld Show only inside Category: aktiv
    Feld Category ID=25
    alle weiteren Felder nicht aktiv.
    Dann wird dieses Menue nirgends mehr angezeigt, auch nicht in Kat 25.

    Grüße

  5. Administrator's Gravatar Administrator
    05.09.2006 at 21:02

    check mal die anzeigeoptionen im wordpress codex unter “conditional_tags”. da sind die auswahloptions erklärt und vielleicht hackt es daran. ich hab es ausprobiert mit schalter is_category + 30,9 (also nur diese cat id´s) und es klappte ohne probs

  6. Klaus's Gravatar Klaus
    05.09.2006 at 12:20

    Hallo Admin,

    habe gerade festgestellt das es immer noch hakt…
    Gebe ich jetzt an nur in z.B.Kat 25 oder 26 anzeigen, wird es überhauptnicht mehr angezeigt.
    Weder in der ausgewählten noch in einer anderen Kat.

    Schaue mal test.ipp-travel.com ( Suchen=25 Info=26 ) da sollte dann jeweils ein eigenes Menue erscheinen.

    Grüße Klaus

  7. Administrator's Gravatar Administrator
    05.09.2006 at 9:54

    hi klaus, vielen dank für dein feedback.
    dein problem mit dem aufklappmenue ist nicht an das widget gebunden, sondern in dem entsprechenden plugin zu finden.
    DIe Probleme mit den anderen Plugins konnte ich noch nicht lokalieiseren. du musst das framework aber nicht aktivieren. das ist nur für den versionscheck sinnvoll.

  8. Klaus's Gravatar Klaus
    05.09.2006 at 0:25

    Leider gibt es noch einen Fehler.
    Die Funktion zeige nur in dieser Kategorie an, als Button aktivieren und die Ziffer der Kat eintragen, bleibt ohne Wirkung.
    Das Menue wird trotzdem in allen Kat angezeigt….

    Grueße Klaus

  9. Klaus's Gravatar Klaus
    04.09.2006 at 15:47

    Wollte nochmal nachfragen an welcher Stelle es möglich ist den falschen /li tag gegen einen /ul Tag auszutauschen.

    so sieht es jetzt aus
    | – 1 Ebene

    | – | – 2 Ebene

    | – | – | – 3 Ebene

    2x /ul nötig !! aber nur 1x vorhanden

    | – | – 1 Ebene

    so sollte es aber sein
    | – 1 Ebene

    | – | – 2 Ebene

    | – | – | – 3 Ebene

    | – 1 Ebene

  10. Klaus's Gravatar Klaus
    04.09.2006 at 12:07

    Leider gibt es offenbar weitere Bugs im Kings Framework 0.7. Bekomme haufenweise Fehlermeldungen seit der Installation im Zusammenhang mit Plugin Post_Level und aLink.
    Nach dem abschalten von Kings Framework läuft alles normal wie zuvor.

    Beste Grüße

  11. Kim's Gravatar Kim
    04.09.2006 at 8:14

    Can you please tell me if i can stop posts showing unless user nagivates to that category?
    IE not all the posts of the children to show up in the main parent.

    please advise what options i have to use if its possible..

    thanks!! having fun with all ur widgets

  12. Klaus's Gravatar Klaus
    03.09.2006 at 23:24

    Ein tolles Plugin, habe es soeben eingebaut da es das derzeit einzige ist welches hervorragend die Aufklappmenu unterstützt.

    Bin aber auf einen Bug gestoßen. Undzwar klappt es mit dem aufklappen nur bis zur 2. Ebene, danach schleicht sich ein Fehler ein.
    Es fehlt offenbar ein , dadurch werden alle folgenden Menue der 2. Ebene zu weit nach rechts verschoben.

    Siehe Beispiel. Wie bekommen ich am Ende der dritten Ebene ein zusätzliches Schließ Tag hinein ???

    Herzliche Grüße

    | – IPP Top Partner

    | – | – Webseite eintragen

    | – | – | – Jens Test Kat

    http://test.ipptravel.com/?cat=82

  13. Administrator's Gravatar Administrator
    03.09.2006 at 18:28

    Please update the framework too. There is a new function.

  14. 03.09.2006 at 16:44

    Simply amazing! I request a feature while late nite browsing, sleep, wake up, and its there! Knowing that you worked this quickly bring me chills! It seems to be the perfect addition, except I am getting an the following error. I tried various settings, each returning an error, even with the most basic settings : “Show only on special page area, and is_home”

    “Fatal error: Call to undefined function: king_in_site_area() in …/king-categories.php on line 112″

    HELP! Thanks, Matt

  15. Administrator's Gravatar Administrator
    03.09.2006 at 13:36

    Thanks for your feedback matt. i´m was kina busy the last month, so my pdates are a little behind. I´ll just updaed the King Categories widget to suit your requests.

  16. 03.09.2006 at 8:29

    “Coming Features: Option to show a Category menu only under a given Category. Very usefull if you have deeply nested Categories… if you need this urgendly write me because it´s nearly finished”

    IM URGENTLY WIRTING YOU! These features would create the ultimate navigation plugin.

    1. If you could select to show the category menu only while browsing a specific category, or the children of that category, or both.

    2. The same thing, only with pages. If you could select to show a certain category menu only while browsing a specific page, or the children of that page, or both. Ive seen this done with a drupal category module by using /page_name/* , with the * acting as a catch all for any page under /page_name/ .

    This flexability would solidify these already rock-solid plugins.

    Thanks for the great work!

  17. 02.08.2006 at 7:49

    thanks for this plugins but i want to know, if it’s possible, how manipulate my CSS to show hierarchical ?

    sorry for my english … i’m french ;)

  18. 15.07.2006 at 3:25

    Is it possible to use your “sliding box” effect from the king text widget with king categories as well?

    I know that king categories can collapse categories other than the current category but I’d really like to be able to hide the entire category list (except for the title) until it’s needed.

  19. 13.07.2006 at 20:47

    Yes…is show 1970 if there is no post at that category. maybe for future version the date can representing the date of category was created if there was no new article at that category…just my suggestion :D
    Thanks

  20. 11.07.2006 at 16:34

    Found wrong date for my categories (1970-01-01 must be 2006-06-07), but it’s OK for child categories.

    how to solve this ?

    Thank You

  21. Metis Online's Gravatar Metis Online
    25.06.2006 at 15:11

    Hi,

    i’ve some problems to get the categories work with folding; I installed the Fold Category List plugin, but it doesn’seem to work. When I check the box; Use Foldable Navigation in the King Cat widget, it just doesn’t show the children, but nottin is folding;)

    is this a known problem?.. what am i doing wrong?
    Im setting op the blog on http://www.outbox.nl/blog/

  22. Constantin's Gravatar Constantin
    14.06.2006 at 15:10

    Georg, thank you for your prompt response! The problem was that I didn’t activated the Widgets plugin (duh!). Now I did activated the Widgets plugin, and the King Category plugin, but I’m not able to see the full customizing menu that you’re describing. I only have access (in Presentation > Sidebar Widgets) to a short King Category Menu that’s asking “How many Category Menus would you like?”

    I have the framework installed in /plugins/ – but I can’t find the option to activate it from the Plugins menu. Is that the cause I’m not seeing the full menu for the widget?

    Thank you!

  23. 14.06.2006 at 10:07

    Thanks for the tip about the plugin. The html errors don’t seem to be in that error – it seems to be some other problem, maybe a conflict with the theme. Anyway, on reflection it’s easier to do this as html in a text box – easier to reorder. Thanks again for your help and interesting widgets.

  24. MP:Schorsch's Gravatar MP:Schorsch
    13.06.2006 at 23:59

    @Constantin: You are missing the widgets plugin, please check the install notes from the framework.

    @bodsham: Please check your sidebar. there is some wrong html in there -> get yourself this firefox plugin to check your sourcecode:
    http://users.skynet.be/mgueury/mozilla/

  25. 13.06.2006 at 23:30

    For some strange reason with King Categories I get one category alone indented each time. i have tried deleting it and recreating it but this category always comes up with the same indent – style=”margin-left:1em. None of the others have it. I’m baffled. http://davidhewson.mydaisy.info/

  26. Constantin's Gravatar Constantin
    13.06.2006 at 23:26

    I uploaded the King Widgets Framework, then the King Categories, but when I’m trying to activate the plugin I get an error message:


    Warning: widget_king_categories_register(widgets.php): failed to open stream: No such file or directory in /wp-content/plugins/king-categories.php on line 471

    Warning: widget_king_categories_register(): Failed opening 'widgets.php' for inclusion (include_path='.:/usr/local/lib/php') in /wp-content/plugins/king-categories.php on line 471

    Am I doing something wrong? Thank you!

  27. 13.06.2006 at 2:35

    Hallo Schorsch,

    wollte nur mal checken ob du deinen Chinaurlaub gut ueberstanden hast und wie der Stand der Dinge ist wegen dem King Pages.

    vielen Dank im Voraus

    Alex

  28. 01.06.2006 at 7:11

    Ach echt!? ist ja genial, du treibst die Spannung ja in die Hoehe ;-) . Waere super wenn du das plugin bald released. wollte meine Webseite liebend gerne fertig haben, bevor ich nach Deutschland zur WM fahre.

    Viel Spass noch in Peking

    Vielen Dank im Voraus

    Alex

  29. mp:schorsch's Gravatar mp:schorsch
    01.06.2006 at 6:55

    @alex: king-pages habe ich schon wie von dir gewuenscht fertig, aber noch nicht released. es muss j noch ein wenig spannung bleiben ;-)

    greatings aus peking

  30. 31.05.2006 at 6:27

    Hallo Schorsch,

    ich kann mich den anderen nur anschliessen, echt ne super Sache deine plugins, Ich habe auch King Category Menu eingesetzt, funzt auch wunderbar, der einzige Hacken, meine Untermenues werden nach links versetzt angezeigt, nicht nach rechts. Irgendeine Idee? Auf das Feature “show a Category menu only under a given Category” freu ich mich auch schon, aber ich goenn dir ja auch den Urlaub.

    Noch ne Frage haette ich, ist es auch moeglich ein widget fuer “Pages” zu machen. Das jetzige vorhandene Widget zeigt leider alle Pages auf einmal an. Waere super wenn man da auch eine Option haette, wo Pages nur auf bestimmten pages angegeben waeren. Waere toll wenn du da auch ein Widget rausgeben wuerdest.

    Schoene Gruesse aus den sonnigen Texas

    Alex

  31. 21.05.2006 at 16:34

    Zitat: Comming Features

    - Option to show a Category menu only under a given Category. Very usefull if you have deeply nested Categories… if you need this urgendly write me because it´s nearly finished /zitat

    darauf freu ich mich schon…. steht schon ein veröffentlichungsdatum fest?

  32. 19.05.2006 at 8:59

    1. set the default switch for the start.

    2. slowly digg your way throught the switches.

    3. use the debugging output ->if you are using king-text you could use it´s PHP feature to insert the list_cats() call with the debugging output manually.

    4. check the Wp-Codex for list_cats() to better understand the Options and switches. There are some options that don´t work with each other.

    5. maybe there is a conflict between two widgets so you could dragg some widgts temp. off the sidebar, to make sure.

    6. if it still won’t work you can write me an email and provide me with a temp. login so i can check if it is a problem with the widget. Since my widgets very diverse you can imagine that i can´t test all possible combinations of all widgets. So i need this kind of feedback.

  33. DLE's Gravatar DLE
    19.05.2006 at 8:58

    First, I want to say that I love King Text–it drives my entire sidebar.

    Sadly, I’ve never been able to get King Categories to work. Even with them enabled, it won’t show the hierarchy, children, li markers…nothing. I have the foldable navigation enabled and that plugin activated and that feature doesn’t work either.

    Yes, when your widget is operating it does show up and shows the title and all top parent categories, but that’s it.

    No idea how to fix this. I recently updated to 8.5 and that fixed nothing. I’ve reset the cache and tried re-installing everything, but nothing makes the features of the King Categories widget work.

    Any ideas?

  34. peb's Gravatar peb
    14.05.2006 at 15:48

    OK, I got it now. And I can use it that way.

    Thanks,

  35. peb's Gravatar peb
    13.05.2006 at 22:29

    I’m trying to use King Categories for a category listing only on the main page using file=index.php. The setting seems to change as I change the file name, but categories show up regardless everywhere.

    I thought the categories could be set for pages, for example, by using the file=page.php, which I use for pages.

    Debugging shows the name is actually getting changed, but nothing happens as a result.

    Any clues? Am I misinterpreting something?

    Thanks

  36. Peter's Gravatar Peter
    28.04.2006 at 14:19

    Danke für die Antwort.
    Aber das ist mir leider zu hoch; ich wüsste gar nicht, wo ich da ansetzen muss. Ich werde mich damit behelfen, die IDs manuell zu ändern; es sind ja nicht so viele.
    Vielen Dank nochmal für Dein Plugin und alles Gute,
    Peter.

  37. Peter's Gravatar Peter
    27.04.2006 at 13:12

    Eine super Sache, dieses Plugin.
    Was ich noch bräuchte, wäre jedoch die Möglichkeit, die Kategorien sortiert nach einer eigenen Reihenfolge auszugeben. Man könnte eigentlich das Beschreibungsfeld dafür “missbrauchen”.
    Wie könnte man nun im Kind Categories Plugin die Sortierreihenfolge so festelegen, dass zusätzlich (oder statt) ID und Name das Beschreibungsfeld anwählbar wäre?

    Vielen Dank im voraud für jegliche Tipps.

    Peter.

  38. 15.04.2006 at 16:49

    One of the problems with list_cats() is that it counts scheduled posts in the post count (a post scheduled to appear in the future that is not visible yet in the category still is counted in post count). I believe this bug has been submitted to WordPress, but we have to wait until who knows when to get a fix. Any chance your widget can override this bug and show the correct post count?

  39. 10.04.2006 at 16:01

    sehr feine sache. da werd ich dann doch neugierig was sich hinter dem wohlklingenden fremdwort widgets verbirgt. sieht gut aus!
    ps: aber bitte bitte baut euch mal ein king_spellchecker (mit einer king_rechtschreibung.mo) natürlich ;-) ich les jetzt schon ein paar artikel (structured micro blogging, etc…) und muss mich nur wundern, dass ihr (alle?) auf englisch schreibt, vermutl. nur weil es sich halt nicht so flüssig liest… hat das einen besonderen grund? oder sprechen medial-schaffende :-O alle so (englisch)?

    hrhrhr … nevermind the klugscheissers ;-)

  40. 09.04.2006 at 5:12

    I went in and hacked my widgets.php to show the RSS icons, but this is much nicer, and will survive when they update the widgets plugin. Thanks!

1 Trackback to WordPress Widget: King Categories

  1. By on 05.07.2009 at 15:36
  2. By on 12.10.2008 at 14:06
  3. By on 15.09.2008 at 18:57
  4. By on 07.12.2007 at 17:37
  5. By on 18.07.2007 at 18:23
  6. By on 14.07.2007 at 9:14
  7. By on 20.05.2007 at 9:51
  8. By on 17.05.2007 at 0:42
  9. By on 17.05.2007 at 0:41
  10. By on 26.12.2006 at 15:33
  11. By on 11.12.2006 at 0:56
  12. By on 07.12.2006 at 3:00
  13. By on 27.11.2006 at 19:48
  14. By on 19.11.2006 at 13:49
  15. By on 14.11.2006 at 5:33
  16. By on 02.10.2006 at 18:27
  17. By on 03.09.2006 at 13:42
  18. By on 02.09.2006 at 5:46
  19. By on 14.08.2006 at 10:37
  20. By on 15.07.2006 at 22:50
  21. By on 09.07.2006 at 21:25
  22. By on 22.04.2006 at 15:01
  23. By on 15.04.2006 at 23:57

Work

Archive