This support ticket is created vor 6 Jahren. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
its outputting all the custom post types rather then one as suppose to , i couldnt find any filter for this at the wordpress archive. is this how its suppose to ?
if i apply search filter i get this : versteckter Link
usually whats the method to tackle this issue , i am sure taxonomy able to share acrosss multiple post types [ base on the taxomony options given ]
That link is the taxonomy archive for the "d01-raffles-place..." term of the district taxonomy.
It will show all posts with that term, irrespective of type.
If you want to customise that, creating a custom archive at Toolset > WordPress archives won't actually help, because it will follow the default behaviour.
You need to use pre_get_posts to modify the relevant query.
Here is an example you can use, where you would have to edit the taxonomy slug, and the post type.
/**
* Limit taxonomy archive to a particular post type
*/
function tssupp_custom_archive($query) {
if (is_tax('sector')) {
$query->set('post_type', array('listing'));
}
}
add_action('pre_get_posts', 'tssupp_custom_archive');
That's back to front when it comes to thinking about archives.
WordPress tries to interpret the URL to work out what you want to display.
Enter a URL in the browser and WordPress will parse it and compare it to your permalink structure to determine what page we are on.
Yes, for individual posts when you save a post it will save it with a url that corresponds to your permalinks ("generate the url").
Looking at your sample URLs I'm not sure what is a post type, what is a taxonomy, what is a term, but it looks like you are wanting to work with custom rewrite rules again.
I don't really have anything to add to what I've written before, that Toolset provides the UI for adding rewrite options when registering custom post types and custom taxonomies, but doesn't have any opinion about what those should be or how to customise them beyond the basics available in the UI.
When it comes to displaying content, it will just display whatever WordPress thinks it should be displaying, i.e. if WordPress interprets your rewrite rules to mean that we are on a particular taxonomy term page, then that is what Toolset will display at that page.
Those sample URLs look like a single post could have one of many possible URLs, but a single post should have a unique URL.
'Looking at your sample URLs I'm not sure what is a post type, what is a taxonomy, what is a term, but it looks like you are wanting to work with custom rewrite rules again.'
custom post type = landed-house, dir
tax : district,
from the discussion it seems like its not straighforward to use one taxonomies to multiple cpt,
i have the plugins to create permalinks, works fine., but not for this case when taxonomies is used in many cpt.
in this case the best way is to create taxonomies for each cpt ? like landed-house-district, office-district , dir-district, etc ?
performance wise i am guessing there is setback since its a tax rather then just layout ? 🙂
It's not a problem to assign a taxonomy to multiple post types generally, the issue arises only because of the custom rewrite rules you want to adopt, which mix the CPT and taxonomy slugs, and so lead to potential ambiguity.
I don't see how this would have any impact on performance if you were to go ahead and create separate taxonomies for each CPT, it just implies more work for you setting it up.
(I'm not sure how the page slug, e.g. listings or directory, is supposed to fit into this.)
As described at the outset, a taxonomy archive will display all of the posts with the specific term assigned, irrespective of post type. We discussed some example code above that can be used to modify which post types are included in the archive.
However, it seems like what you want is to be able to include the CPT slug in the URL and then modify which type of posts are shown in the archive based upon that CPT slug included in the URL.
I'm sorry but I can't help you with that. You'll need an expert in rewrite rules to know whether it is even possible, and to implement it if it is.
This isn't an issue that is specific to Toolset in any way, you would be in the same position if you had registered the post types and taxonomies manually without using a plugin.
Which is good news inasmuch as you don't need a Toolset expert to solve this, you just need a WordPress rewrite rules expert.
I'd suggest you try asking on wordpress.stackexchange.com first, and if you can't find the answer you need there, you'll need to look at recruiting a developer to implement this particular request for you.
Thank you for all the explanations, without this explanations, i cant barely move forward.
i just wanted to confirm if i missed antyhing on the usage of post-relationship
Now that i am clear and decided to add/duplicate the tax for each of the post types that required. url rewriting is straight forward for this case ,same as the :directly: cpt.