Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It depends on how deeply it needs to be integrated. As long as “trailer” does not have any special meaning to WP, such as a taxonomy or post type slug, you can create arbitrary links in post content which include “trailer” and WP will ignore it and still locate the named page or post. But WP will also rewrite the URL to what WP considers to be the proper permalink, so the “trailer” element will disappear from the address bar as the page loads.

    To formally introduce “trailer” as part of an URL, you would need to use the Rewrite API to add a rewrite rule. Then the element becomes recognized and the URL will not change when used.

    To have WP add the trailer element to URLs that it creates, there are filters you can use. The correct filter depends on the object type being targeted. For example, “post_link” filter for posts, “page_link” for pages, etc. Review the source code for get_permalink() to determine filters used for other object types.

Viewing 1 replies (of 1 total)

The topic ‘WordPress – Different URL Structure before some posttypes and pages’ is closed to new replies.