Plugin allows to select category which will be used to generate permalink on post edit page. Use custom permalink option %scategory% on Options/Permalinks options page.

Installation

Download and unpack plugin files to the wp-content/plugins/scategory-permalink directory.

Enable sCategory Permalink plugin on your Plugins page in Site Admin.

Open the Options/Permalinks page in Site Admin and use %scategory% option in Custom Structure text field (you can look here for other options). In this blog I’m using /%scategory%/%postname%/ structure.

When you move your mouse over category in Categories box the Primary link will appear on the right.

Click it to set the category which will be used to generate permalinks. It will be highlighted with bold.

Have fun!

Upgrade

Download and unpack plugin files to the wp-content/plugins/scategory-permalink directory.

Open the Options/Permalinks page in Site Admin and and click Save Changes to re-generate permalinks.

When you move your mouse over category in Categories box the Primary link will appear on the right. Click it to set the category which will be used to generate permalinks. It will be highlighted with bold.

Demonstration

I have recorded a small screencast on how sCategory Permalinks works starting from version 0.6.0:

Requirements

Plugin works pretty well with the WordPress 2.7.0 — 2.8.2. Hey users of WordPress 2.7.0, could you explain why do you use so old buggy crap? Use new one instead, at least it looks more beautiful!

Download

Latest version of sCategory Permalink is 0.6.2, and it could be downloaded here:

Development

Feel free to check them out, make your changes and send me patches. Promise, I will apply every patch (of course, if they add a value to the product). Email for patches, suggestions, or bug reports: [email protected]. Also you have much more ways to contact me.

Changelog

0.6.2 (July 30, 2009)

Nothing really changed. Just to force WordPress to update version.

0.6.1 (July 30, 2009)

Fixed blank page when post edit page requested.

Fixed “Primary” link appear on all sub-categories, when category selected.

Okay, you could help me (and other plugin users) if you would post some additional information: your browser (and maybe plugins, which you are using in it, especially if they are modifying html somehow,- just like greasemonkey for Firefox does), wordpress version (2.1.3 or less?), wordpress plugins (this is most important information).

You can send me this information by email ([email protected]) or post in comments. I know, it’s not easy to collect all this information… You could make several screenshots of you wordpress plugins page at least. It would be perfect.

Of course, I’m trying to locate the problem myself, but it’s not easy to reproduce.

A really great and important plugin. i have a question, though. it seems to me that your plugin also creates new category url’s.

If domain.com/categoryname/postname than domain.com/categoryname is created for the category page.

These url’s do not replace the normal wordpress ones (domain.com/category/categoryname). That’s a shame, because category-label links under posts link to the old default url’s, while the new ones are much more logic.

I tried to fool wordpress by defining category permalink as /somestring/categoryname and post-permalink /somestring/categoryname/postname. This makes post-url return 404 though :-(.

Dmytro I figured out why people are having a hard time getting the radio buttons to show on the post page. It’s quite simple:

– On the scategory_permalink.php page, there is this line of code:

1

var$pluginLocation='/wp-content/plugins/scategory_permalink';

If the users are anything like me, they simple unzipped the folder as “scategory-permalink.0.2.2” so that directory that is calling on the folder isn’t correct. If you simply change that line to:

1

var$pluginLocation='/wp-content/plugins/scategory-permalink.0.2.2';

You got the radio buttons to show! I’m sure there’s a better way you can do this… a way where you don’t even have to change that $pluginLocation… just have it so it knows no matter where it is located (since the user, like many of us, will have made the mistake in unzipping it in a different directory than the one you put hard coded in the file)

I have used your plugin as a starting point for creating a similar one NG Primary Category WordPress plugin which inserts the radio boxes without using any Javascript (through PHP output buffering & regular expressions).

You might want to check the source code. Your comments / suggestions will be very welcomed since your PHP experience seems very advanced.
If it wasn’t for the %scategory% your plugin would have saved me from all the trouble!

Congratulations for having an excellent site, combining very good layout / presentation with very interesting subjects.

Hi Nick: I’m very interested in using your NG Primary Category WordPress plugin, but can’t download it since your site appears to be down. Any chance you can get it loaded into WordPress’ plugins section?

Dmytro: No insult intended! Your plugin appears to work great so far, but I’d like to compare with Nick’s to see which works best for me.

I’m using WP 2.2.x, activated plugin, followed the directions and I (like the guy with the previous version you fixed) am not seeing the radio buttons come up either.

I am also getting on the write new post page an error message line 481 on post-new.php. “object expected”. When I “turn back the hands of time” and deactivate your plugin and take the scatagory out of permalinks, the write page shows no errors, so it seems this is the problem.

dear dmytro, ive installed everything according to the instructions, but the chosen (radiobutton) category does not show as the first one in my theme…

an example: at http://handshake.se , ive chosen “tech” (ca 19) as the main category for the latest article on intels atom. neverhteless, the article shows up as “hardware” (cat 34). i ve got no explanation for this.

Mmm, this may be a silly question, but next to each category there is a checkbox and a radio but – what is the purpose of having both of these? If i’m going to assign a post to a specific category should I select both the radio button and checkbox across from that category or only the radio button?

I’m just mystified about the checkbox when there is only reference to the radio button above.

Hi,
sadly the plugin is not working correctly with WP 2.6.1. The correct URL, as it is supposed by me, will be produced but it leads to 404. Any Chance for an update?

@Nick
The checkboxes are used originaly by WordPress to assign one (or more!) categories to your post. The Radiobutton is used by this plugin to asign only one category to your post that should be displayed in the URL if you are using the permalink feature by WordPress. If you always assign only one category to your posts, or you are not using permalinks, you don’t need this plugin.

This is a great plugin, but is there a way to do it without using %scategory% and just the standard %category%? I’d like the actual permalink to be manipulated upon saving the post.

I’m building a site where posts are categorized under several different sub-categories, but I want the permalinks to be created from only one set. But I would like the posts to appear in the pages for the other categories as well.

I’d like for permalinks to be /issues/july-2009/post-name.html and I would like to be able to go to /topics/development and see the post listed there. With %scategory% I currently get a 404 for /topics/development. How can I manipulate the actual permalink creation not using %scateogry%?

Let me know if you need more clarification and thanks for all the great work you have out into this plugin!

My permalink was the tradicional /%year%/%monthnum%/%day%/%postname%/ and I changed it to /%post_id%/%scategory%/%postname%/

During the past week I’ve been testing a lot of configs, tried to mix scategory with permalink-redirect and top-level-cats, it made a too much trastic change in WP core and something was always not working.

After learning more about htaccess and trying to redirect error permalinks to working ones, I abdicated of top-level-cats and made most of permalink-redirect directly in htaccess, leaving only scategory.

But something is still not working. As soon as I change parmalink, pages URLs break. They all start returning 404 and nothing can stop it.

Thank you for providing a great plugin.
I am having the same problem as Jon with subcategories. At this point I am getting a 404 when someone submits a comment. No 404 elsewere. I hope to hear about solution soon. Thank you.

actually, sorry, the problem goes away when I completely deactivate the plugin… but of course none of the inbound links to my blog link to the right pages because all the urls changed back to default categories.

Yes, that’s what I did when I installed it, and it worked fine, however the Pages (again, pages, no posts) stopped working – they all resulted in 404’s.

the temporary fix for me was to go back to the %category% method… this actually didn’t work (even after re-saving), and I had to actually deactivate the plugin for it to start working.

NOW, the big problem is that my permalinks have reverted back to the originales (ie with categories other than the ones I selected with your pluin), and so links coming into my site all point at pages that do not exist.

The main problem is that your plugin causes my pages to 404. The secondary problem is that my inbound links are messed up now because i had to deactivate the plugin to make my site work.

Post a comment

Name (required)

Email (will not be published) (required)

Website

You can use simple HTML-formatting tags (like <a>, <strong>, <em>, <ul>, <blockquote>, and other). To format your code sample use [cclang="php"]$a = "hello";[/cc] (allowed languages are ruby, php, yaml, html, csharp, javascript). Also you can use [cc][/cc] block and its syntax would not be highlighted.