Jump to content


Photo
- - - - -

Custom Taxonomy In Permalink

taxonomy permalink

Best Answer Rob , 02 December 2012 - 05:30 PM

I'm sorry if I misunderstood you or if I failed to explain that pages don't normally use custom taxonomies, and thus the permalinks are unlikely to reflect them.  I think the reason it does with the post-id first is that it's then treating the custom taxonomy as a category after the post-id.   Perhaps if you swapped the category and location around, the same effect may occur without the post-id.

 

This is a WordPress issue and there may be some topics in their forum that may of greater help.  It really isn't PageLines related.

Go to the full post


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts

Posted 02 December 2012 - 11:52 AM

Hi,

 

I've created a custom taxonomy (for location) and I would like to have this taxonomy in my permalink. 

 

Now I have: %category%/%postname% and I would like to have %location%/%category%/%postname%.

 

Via google I found this code:

 

Please Login or Register to see this Hidden Content

 

 

It is working for posts. However, I get 404 errors on pages. Hence, there is some permalink conflict. Any suggestion to fix this? 



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 02 December 2012 - 12:57 PM

Hello Jan,

 

Personally, I use Custom Press for creating taxonomies, which allows me to integrate them into posts, pages and even media files.

 

However, in another site where I've needed categories attached to pages (not a usual thing), I've used this plugin. 

Please Login or Register to see this Hidden Content

 

It might help you to achieve your goal. It's well maintained by its developers.

 

You may wish to continue on the customization path you've already taken, without plugins, so this might explain how to register the taxonomy for pages. 

Please Login or Register to see this Hidden Content



#3 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts

Posted 02 December 2012 - 02:00 PM

Hi,

 

Thank you for your time.

 

I am fine using the register taxonomy function. Maybe I was not completely clear. I don't need a custom taxonomy for pages (you can set the taxonomy to work with pages in the above function if you want). I just would like the permalink structure for my posts to contain the location taxonomy. I was able to do so with the code from my first post, but it generates 404 errors for pages, strange as I thought pages are on top of the tree. 

 

Maybe I could go they way you are suggesting, but it doesn't sound dynamic to me. I would have to create a page each time I add a location. 

 

Anu other ideas?



#4 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts

Posted 02 December 2012 - 02:04 PM

Just discovered that /%post_id%/%locatie%/%category%/%postname% resolves the 404 errors on pages, but I do not want a post_id in my url... :-)



#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 02 December 2012 - 05:30 PM   Best Answer

I'm sorry if I misunderstood you or if I failed to explain that pages don't normally use custom taxonomies, and thus the permalinks are unlikely to reflect them.  I think the reason it does with the post-id first is that it's then treating the custom taxonomy as a category after the post-id.   Perhaps if you swapped the category and location around, the same effect may occur without the post-id.

 

This is a WordPress issue and there may be some topics in their forum that may of greater help.  It really isn't PageLines related.



#6 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts

Posted 02 December 2012 - 06:10 PM

Hi,

 

I realize it is a wordpress issue, but just hoped someone here had the same issue :-)

 

Actually. Category/location/postname is working (hence, not giving 404 errors on pages). However, it is not a logical structure for my site... It is driving me crazy. Sound like a pretty simple (and common!) option to me.

 

Thank you for your help.