• Resolved nitrospectide

    (@nitrospectide)


    I have a page with the Title “Event Listing” and the permalink (via Permalink Manager Lite) /events. I needed to override the page via the page hierarchy, so I used page-events.php. This did not work. It only overrides when I use page-event-listing.php. Why?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Maciej Bis

    (@mbis)

    In general, custom permalinks use native slugs by default. However, they did not have to because, as you know, you can fully customize it. You can, for example, remove the slug from the custom permalink.

    Many use this feature, for example, when they want to use a numeric ID or SKU number instead of a slug. It can be also helpful when one needs to use the same slug again in a custom permalink for another post or page.

    Custom permalinks are only used in permalink filters and dynamically replace the default permalinks (which are made up of native slugs). This is done programmatically, thus it has no effect on the native slugs. In other words, updating the custom permalink does not affect the native slug.

    Because the function that selects the template file uses native slugs ($object->post_name), the slugs must be used in the template file names:

    https://developer.www.ads-software.com/reference/functions/get_single_template/

    If needed you can display the native slug inside the permalink editor:

    https://permalinkmanager.pro/docs/plugin-settings/wordpress-slugs-explained/#permalink-manager-edit-slugs

    Thread Starter nitrospectide

    (@nitrospectide)

    Thank you!

    I did not realize that what I was seeing in the permalink editor field was separate from the page slug. The setting for showing the native slug field was exactly what I needed. I updated my slug, matched my template name, and it works perfectly now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Slug is completely different from permalink?’ is closed to new replies.