WordPress.org

Ready to get started?Download WordPress

Forums

Category Permalinks (17 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    Hello,
    I use WP 1.0.1 and am about to translate it on German.
    Gladly I would translate the category permalinks on German also. I want WP to make permalinks like "/kategorie/allgemein/" instead of "/category/general/".
    What I have to change, so that WP generates permalinks with "kategorie" instead of "category"?
    Any help would please me very much.
    Std.

  2. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    For 1.0.1, look for the following line in wp-admin/options-permalink.php:
    $catmatch = $front . 'category/';
    Change category to kategorie.
    In nightly builds, the rewrite rules have moved to the rewrite_rules() function in wp-include/functions.php.

  3. Anonymous
    Unregistered
    Posted 10 years ago #

    Thanks for the hint, but it don't works. I've changed the options-permalink.php, loaded it up and copied and pastet the new rewrite rules into my .htaccess and loadet it up, too.
    The URIs work fine, if I type something like "/archiv/kategorie/allgemein/".
    The Problem is the generated URIs on the Blog. WP still makes links with "/archiv/category/allgemein/" instead of "/archiv/kategorie/allgemein/".
    How may I change this behaviour?

  4. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    Oops. You also need to change get_category_link() in template-functions-category.php. Change this line:
    $link = get_settings('siteurl') . $front . 'category/';

  5. Anonymous
    Unregistered
    Posted 10 years ago #

    Thank you very much!
    Just for documentation: In my template-functions-category.php the line is:
    $link = $siteurl . $front . 'category/' . $category_nicename . '/';

  6. Kerim
    Member
    Posted 10 years ago #

    A couple of things:
    (1) The option %category% seems to exist, but it isn't included on the permalink options page. It should be added there.
    (2) Once added, it seems to work, except that the peramlink to an individual post appears with %category% in the link, rather than the parsed actual category corresponding to that value.
    (3) I would like to remove "category" from category links altogether. So:
    http://www.mysite.com/category/the actual category/post-name.php
    appeared as :
    http://www.mysite.com/the actual category/post-name.php
    without the word category.
    I tried editing template-functions-category.php, but it didn't seem to do anything. I think I need to edit the mod_rewrite rules in .htaccess, but I don't know how to do this, and I'm not sure the automatic parser will know I've changed the template file...
    Thanks!

  7. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    Making use of %category% is on the todo list. Also %author%, %feed%, and so forth. This requires some admin UI changes since posts, categories, authors, etc. each need their own permalink structure. As you noticed, adding %category% to your permalink structure affected the post permalink. These need to be separately configurable so as to avoid that.

  8. Kerim
    Member
    Posted 10 years ago #

    I hope this can be fixed soon, as it is integral to the way I envision laying out the web site I am working on. Glad to know its on the todo list!

  9. snej
    Member
    Posted 10 years ago #

    Let me add my vote, too -- I really want to be able to set up my permalinks this way.
    /the-category/the-post-title
    /the-category/
    /year/month/

    etc.
    (Of course I realize this causes problems if there are duplicate post titles in a category; but I'm willing to live with that.
    I'm learning my way around PHP, so if someone wants to give clues on working around the issues that rboren mentioned above, I'm all ears.

  10. OperaManiac
    Member
    Posted 10 years ago #

    i want category slugs... :(

  11. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    Code is more useful than votes. ;-) Once 1.2 is out and development of the next version ramps up, I'll look into making permalinks for authors, categories, feeds, etc. more configurable. Of course, care must be taken to make sure that your permalink structures are viable. You can't have this:
    /author-name/
    /category-name/
    Since authors and categories are both arbitraray alphanumeric strings, they clash with each other. That's why you need something like:
    /author/author-name/
    /category/category-name/
    Those fixed string prefixes are needed. You will have to make compromises if you don't want to use directory prefixes.

  12. OperaManiac
    Member
    Posted 10 years ago #

    since i do contextual linking a lot, i will have to stick with the default.
    just dont leave that option out :)

  13. Anonymous
    Unregistered
    Posted 10 years ago #

    Let me voice my vote for adding something like %category% to the Permalink structure options. Here's how I'd love to see it, or how it would work best for what I want to do:
    Say I have these categories:
    TopCategoryOne
    - SubcatOfTopCatOne
    TopCategoryTwo
    - SubcatOfTopCatTwo
    I'd like the permalink structure to be defined as:
    /%category%/%year%/%monthnum%/%day%/%postname%
    Where category would be the top level category (if specified). So, if I posted an entry in SubcatofTopCatOne (and TopCatOne), the permalink would look something like:
    http://url.com/topcatone/2004/04/22/post-name
    Hmm. But then there may be exceptions. I guess it could be tough to decide which category to use for the permalink if posted to many categories at the same level.
    Also, as a side request, it would be nice to be able to specify options for the %postname% Permalink parameter. For instance, to use _ instead of -, or limit to x number of characters (helpful for posts with really long titles). I'd rather not have to modify the php code, if something like this was available.

  14. BoInG
    Member
    Posted 8 years ago #

    For 1.0.1, look for the following line in wp-admin/options-permalink.php:
    $catmatch = $front . 'category/';
    Change category to kategorie.
    In nightly builds, the rewrite rules have moved to the rewrite_rules() function in wp-include/functions.php.

    Oops. You also need to change get_category_link() in template-functions-category.php. Change this line:
    $link = get_settings('siteurl') . $front . 'category/';

    I'm trying to do the same think for the last version of WP 1.5.2.

    Is there someone that knows what i have/where i have to change(the file), so i can translate /category/ into something else like /categorie/ (in my language).

    also - expecting, if possible, some replys here:
    http://wordpress.org/support/topic/41941
    http://wordpress.org/support/topic/41937

    tnq

  15. etitor
    Member
    Posted 8 years ago #

    Hi BolnG, hi everybody. I want to achieve just this translation on my WP 2.0 blog. Is there anybody out there who knows how to translate the permalink structure, as it will appear on URLs, to other languages (i.e., 'category' becomes 'categoria', 'date' becomes 'fecha', 'author' becomes 'autor', and so on).

  16. etitor
    Member
    Posted 8 years ago #

    OK, I think I found it. You have to modify classes.php. I will try and then tell you.

  17. etitor
    Member
    Posted 8 years ago #

    Yes it works!

    The nitti-gritty details may be more difficult to state, but replacing this:

    category/

    with this:

    categoria/

    in file classes.php under wp-includes did the trick for me.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.