• Resolved cag8f

    (@cag8f)


    Hello. I would like to know if your plugin can help me resolve my issue. On my site (https://www.everasia.com/), my theme defines a particular custom post type (“property”). Attached to this custom post type are two different custom taxonomies: ‘property-type’ (with allowed values of property and land), and ‘sale-type’ (with allowed values of sale and rent).

    Currently, every one of these custom posts has a URL of the form:

    https://www.everasia.com/property/{property name}/

    I would like to change the permalinks to that each ‘property’ has one of three different URLs:

    Houses for sale have the URL: https://www.everasia.com/property-for-sale/{property name}/
    Houses for rent have the URL: https://www.everasia.com/property-for-rent/{property name}/
    Land for sale has the URL: https://www.everasia.com/land-for-sale/{property name}/

    Would it be possible to do this using your plugin? The devs for the Custom Permalinks plugin said your plugin would be more suited for my issue (see forum post here).

    Thanks in advance.

Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @cag8f ??

    Yes, this plugin works with different structure for different PostTypes. You can use all the Tags which are defined on the Plugins page.

    Custom Taxonomies Tags are not supported in the current released version available in the WordPress.

    But it would be available soon in the version 2.0.0 which is currently in the development process. This version would contains some enhancements + fixing bugs. Custom Taxonomies Tags enhancement are completed and ready for review.

    If you like so, you can download the version from the Github and use that or use the version available in the WordPress and wait for the upcoming update.

    Thanks,
    Sami

    Thread Starter cag8f

    (@cag8f)

    >> If you like so, you can download the version from the Github and use that or use the version available in the WordPress and wait for the upcoming update.

    Well it sounds like I’ll need to use the ‘custom taxonomies tags’ enhancement, so if possible, could I download version 2.0.0 to my dev site and play around with it to see if it can do what I want? If so, can you link me to the GitHub page? Is this it: https://github.com/yasglobal/permalinks-customizer?

    Also, with the new version (2.0.0), is there documentation yet as to how to use the custom taxonomies tags?

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    You can find the version 2.0.0 updates over here:
    https://github.com/yasglobal/permalinks-customizer/tree/develop_2x

    Custom Taxonomy Tags can be used as mentioned here:
    https://github.com/yasglobal/permalinks-customizer/tree/develop_2x#tags-for-posttypes

    Make sure to use this on your dev site for play around and provide your feedback here. Once you feel comfortable to deploy this to prod so, let me know maybe the official release will going to be available on 2 – 3 days. So, you can directly grab that from the WordPress site.

    Thanks,
    Sami

    Thread Starter cag8f

    (@cag8f)

    >> maybe the official release will going to be available on 2 – 3 days

    OK thanks. I actually won’t get to this for a few days anyway. At that time, maybe you will have released the update. I’ll check back then. Thanks!

    Thread Starter cag8f

    (@cag8f)

    Hi there. I am ready to begin work on this project. But has version 2.0 been released yet? Or should I download it from the GitHub repo?

    Thread Starter cag8f

    (@cag8f)

    OK I’m revisiting this, and have installed v2.0.0 of your plugin on my site. So how do I approach my issue? To reiterate, I have a particular custom post type on my site: ‘Properties’. There is also a custom taxonomy: ‘Status.’ Every post of type ‘Properties’ has its ‘Status’ set to ‘statusa’ or ‘statusb.’ I would like the URLs of every ‘Properties’ post type to have the form: https://www.example.com/{status}/{post-name}/ In other words, every post of type ‘Properties’ will have one of these two URLs:

    https://www.example.com/statusa/{post-name}/
    or
    https://www.example.com/statusb/{post-name}/

    The assigned URL should be conditional on the the value of the taxonomy ‘Status.’ Does that make sense? Is that possible with your plugin?

    Thanks.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @cag8f Please use the custom taxonomy tag as mentioned on the Plugins page.

    <%ctax_custom_taxonomy%> : A sanitized version of the custom taxonomy where the taxonomy name is custom_taxonomy. Replace the custom_taxonomy with your appropriate created taxonomy name.
    If you want to provide the default slug which is used when the category/taxonomy doesn\’t be selected so, make sure to provide default name/slug which looks like this: <%ctax_custom_taxonomy??sales%>. Value which is written between the ?? and %> is used as default slug.

    As your custom taxonomy name is “status” so, use this structure in the PostType Settings of Properties.
    <%ctax_status%>/%postname%/

    Or if you want to add default taxonomy in the permalink then use this custom taxonomy tag like this:
    <%ctax_status??statusa%>/%postname%/

    Default Value can be separated by ?? in the custom taxonomy tag.

    Let me know, if you have any other question.

    Thanks,
    Sami

    Thread Starter cag8f

    (@cag8f)

    OK thanks for that. I followed your instructions and set the structure of the ‘Properties’ PostType Settings to:

    <%ctax_property_type%>/%postname%/

    and it *nearly* worked. But the URL structure doesn’t seem to be consistent across all posts of type ‘Properties.’ The taxonomy in-question, ‘property_type,’ has several values, and some are nested under others (screenshot). For posts that have a nested value assigned, the plugin doesn’t always set the correct URL. Here is a screenshot comparison of two different posts, each assigned a different ‘property_type’ value, and each assigned a different URL structure. Do you see how the first property has a URL containing only the top-level taxonomy value (i.e. ‘property’) while the second property has a URL containing both the top-level taxonomy value and the second-level taxonomy value (i.e. ‘property’ *and* ‘villa’). Thoughts on that?

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @cag8f In the first post, there is no primary category. Maybe, that’s why. Choose the primary category and check again.

    Thanks,
    Sami

    Thread Starter cag8f

    (@cag8f)

    OK I tried that. Now they both have ‘Property’ as the primary, but there was no change (screenshot).

    As a test, I changed the one property from ‘Landed House’ to ‘Condominium,’ and this time the URL structure changed to /property/condominium/ (screenshot).

    What is the expected behavior when there are multiple taxonomy values assigned to a post like this? Should the URL structure contain all taxonomy values, or only one? My requirement is that the URL structure contain only the top-level taxonomy selected (i.e. ‘Property’ or ‘Land’). All of these posts will be sure to have only one top-level taxonomy assigned.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    When the multiple taxonomy values are selected then the first taxonomy is used in the permalink.

    If 2 taxonomy is selected first is parent and the other one is child of that then the parent category is used.

    Thread Starter cag8f

    (@cag8f)

    >> If 2 taxonomy is selected first is parent and the other one is child of that then the parent category is used.

    Sorry, can you clarify this? Are you saying that when a parent and child are selected, *only* the parent should be used in the URL?

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Yes, that’s correct.

    Thread Starter cag8f

    (@cag8f)

    OK. That is what I would like to occur. But that is not what is happening on my site–correct? My site uses both parent and child.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @cag8f Give it a try with 2 new post and check it again.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Can your plugin create custom URLs for my custom post type?’ is closed to new replies.