#45159 closed defect (bug) (invalid)
Embed template not loaded with certain custom post types
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Embeds | Keywords: | |
Focuses: | Cc: |
Description
We use a handfull of different custom post types. The internal embeding works fine for most, showing the iframe with the abstract, page logo, etc. But with some it doesn't work, it only shows the post title.
The only major difference I found, is, that the falling cpt has the special rewrite setting with_front set to false.
I traced it back, the problem is, that it isn't even calling the embed.php template in the theme directory, it is failing before.
Change History (4)
#2
@
6 years ago
To give you a live example, try to embed this url:
https://kupf.at/zeitung/139/kulturpessimismus-fuer-fortgeschrittene/
But if you open https://kupf.at/zeitung/139/kulturpessimismus-fuer-fortgeschrittene/embed it shows the correct embed code.
Note: See
TracTickets for help on using
tickets.
Update: I'm pretty sure meanwhile it has something to do with the custom rewrite rules we use for this custom post type.
We have 2 posttypes called "zeitungsausgabe" and "zeitungsartikel".
The rewrite of "zeitungsartikel is basically "zeitung/%zeitungsausgabe%/%zeitungsartikel%", which we resolve by setting custom add_rewrite_tag called "z" and adding custom rewrite rules and filter the post_type_link to account for it.
It seems like the function url_to_postid doesn't account for custom rewrite tags, as it resolves the url to