[wp-hackers] Ordering categories in permalinks

Otto otto at ottodestruct.com
Sat Nov 6 00:17:21 UTC 2010


What WordPress defines as the "correct" url is determined by the
results of get_permalink(). If you modify that, as I suggested, then
you are redefining what the correct URL actually is.

-Otto



On Fri, Nov 5, 2010 at 6:29 PM, William Davis <will.davis at gmail.com> wrote:
> That will only half work, I think. WordPress will redirect you to what it
> defines as the correct url. So you can link someone to
> http://new.bangordailynews.com/2010/10/25/business/lepages-cleared-in-florida-tax-case/
> (even if it isn't in the business category, which is nice), but it will
> redirect you to
> http://new.bangordailynews.com/2010/10/25/politics/lepages-cleared-in-florida-tax-case/.
>
> Will
>
> On Nov 5, 2010, at 7:23 PM, Otto wrote:
>
>> No. WordPress doesn't actually *use* the category in the permalink to
>> retrieve posts, so you'd just need to modify the output of the
>> get_permalink function. You could do this using the post_link filter,
>> but you'd have to copy all the functionality of the get_permalink
>> function to do it.
>>
>> -Otto
>>
>>
>>
>> On Fri, Nov 5, 2010 at 6:20 PM, William Davis <will.davis at gmail.com>
>> wrote:
>>>
>>> Awesome, just checking.
>>>
>>> So, back to the original question, which is exactly what hook do I use to
>>> modify the category order? Would that be post_rewrite_rules?
>>>
>>> Will
>>>
>>> On Nov 5, 2010, at 7:19 PM, Otto wrote:
>>>
>>>> On Fri, Nov 5, 2010 at 6:14 PM, William Davis <will.davis at gmail.com>
>>>> wrote:
>>>>>
>>>>> We're actually not starting the permalink with the category (the full
>>>>> structure is
>>>>> /2010/10/25/politics/lepages-cleared-in-florida-tax-case/).
>>>>> I
>>>>> saw this post a long time ago and kept that in mind.
>>>>>
>>>>> With the date in there, is it still considered harmful? My boss was
>>>>> pretty
>>>>> adamant about getting the category in there (it's a feature of the old
>>>>> CMS
>>>>> that we use quite a bit).
>>>>
>>>> No. It's only when the first %whatever% bit is a non-numeric field
>>>> that it's harmful.
>>>>
>>>> -Otto
>>>> _______________________________________________
>>>> wp-hackers mailing list
>>>> wp-hackers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list