J B
Forum Replies Created
-
What is your permalink structure? If I had to guess, I’d say it’s just the slug. If so, that’s not anything I can fix. You’ll have to differentiate your permalinks somehow. Most people do this by prefixing the permalink structure with the post type.
@nerrad: +1,000,000,000
Forum: Fixing WordPress
In reply to: Custom Post Type and Taxonomy pagination permalink 404 errorTry changing the permalink from
/recette/%recipe-category%/%herve_recipe%/
to/%post_type%/%recipe-category%/%herve_recipe%/
.Forum: Fixing WordPress
In reply to: Taxonomy Count BugI’m experiencing the same behavior. Working on a patch/plugin to fix it…
You’re getting the 404 error because every single one of those permalinks in regular expression form, without the post_type anchoring them, will look like
/(.*?)/([^/]+)/?
Meaning when WordPress tries to find a match, all post types look exactly the same. So if you have registered Reviews, Articles, and News in that order, WordPress will interpret a URL for Posts, pages, News, Articles, and Reviews as Reviews (or News, depending on how the registration was handled). In fact, nothing but the home page will work. You need to differentiate your permalinks.%post_type%
does that. If you need that gone, then you shouldn’t be using custom post types; you should be using custom taxonomies.Use
%post_type%
instead of justsomething
. Plain text means nothing to the rewrite engine. You have to have rewrite tags to insert meaningful data into the structure. Your current permalink (except for single views) is basically telling WordPress to get your posts’ archives because you don’t have%post_type%
anchoring the whole structure telling WP to look for that post type.Forum: Plugins
In reply to: [Custom Post Permalinks] Custom Post Permalinks not working for meHi randaclay,
That’s a very standard post type structure (and one I use frequently). I just tested it and it works fine for me.
What plugins/themes are you using that could have anything to do with custom post types or rewrite rules?
-John
Forum: Plugins
In reply to: [Custom Post Permalinks] [Plugin: Custom Post Permalinks] Custom taxonomiesNo problem!
I haven’t looked, but I imagine it would be somewhat difficult to get custom taxonomies to work in the regular posts, since that post type has an elevated status. It uses the rewrite engine in ways that nothing else does, so that would involve so many sanity checks in so many other places that it would be difficult to keep it under control.
Of course, I could be wrong. It could be as simple as just hooking into a filter at the end of
get_permalink()
and doing astr_replace()
call to replace the taxonomy’s rewrite tag with its slug.Forum: Plugins
In reply to: [Custom Post Permalinks] [Plugin: Custom Post Permalinks] Custom taxonomiesThe structure would look something like this:
/%post_type%/%location%/%restaurant%
The one caveat is that you have to use the actual registered name of the taxonomy, not its display name.
Forum: Alpha/Beta/RC
In reply to: Using year/month/day permalinks with custom post types@romanczar: Or you could just have single-news.php and it would automatically work for single items in your custom post type.
@cuban_cigar The only time my plugin adds /post_type/ to your permastruct is when your permastruct matches that of the blog post permastruct without it. If your post type needs to look like a page or post, maybe it should be one. Also, the post_type/post_name structure is not a problem the way I’ve done it (for all intents and purposes, the same way WordPress itself does it). If you want to learn the wp_rewrite engine to decide how you would do it better, be my guest. Nobody forces you to use my plugin, or even WordPress for that matter. If it doesn’t suit your needs, maybe you should use something else. Maybe you should try drupal. Your sour attitude and uneducated denunciations lead me to believe you’d fit right in there. Unless you want to take the time to learn the WP_Rewrite API like I did, maybe you shouldn’t tell me the plugin doesn’t work when it does that because I wanted it to PREVENT you from accidentally bringing your whole website down.
Have a nice day!
??
Forum: Plugins
In reply to: [Custom Post Permalinks] [Plugin: Custom Post Permalinks] Yearly archivesI did this once and you basically have to rewrite the wp_get_archives function to suit your needs.
Forum: Plugins
In reply to: [Custom Post Permalinks] [Plugin: Custom Post Permalinks] Custom taxonomiesThis was added in version 1.1, available for download/update now!
Forum: Plugins
In reply to: [Custom Post Permalinks] [Plugin: Custom Post Permalinks] Archive Tempaltes?I’m not sure if this will work, but try changing
blog
to%post_type%
. That is,/%post_type%/%year%/%monthnum%/%blog%
.Also, can you view single posts with your structure?
Forum: Plugins
In reply to: [Custom Post Permalinks] [Plugin: Custom Post Permalinks] Archive Tempaltes?Gotcha. The permalink tag for months is
%monthnum%
not%month%
(at least for my plugin. I’m fairly certain that’s how it works for core too). If you use that, it should work.Forum: Alpha/Beta/RC
In reply to: Using year/month/day permalinks with custom post typesSorry for the delayed response. Adding custom taxonomy support will be in a future release. I haven’t had the time to make sure I’ve got it working, so it’s just not ready yet. My plugin actually circumvents the whole permalinks functionality for custom post types, so adding the ability to factor in taxonomies involves a decent amount of work (categories are handled by core, so I was able to just use what was already there; this isn’t the case for custom taxonomies, unfortunately). The good news is that someone has made a temporary fork of the plugin available here:
https://rapidshare.com/files/416341951/custom-post-permalinks.php
You should be able to replace the main plugin file with that code. I have not actually tested that code, so I cannot vouch for it or offer any support for it, but it was offered as a patch, so if it checks out it’ll be incorporated into the next version.