#395 closed defect (bug) (fixed)
Unexpected preview result on Themes Directory
Reported by: | wikicms | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Component: | Theme Directory | Keywords: | has-screenshots |
Cc: |
Description
I opened simultaneously in preview mode two tabs:
No.1 http://wordpress.org/themes/capture
No.2 http://wordpress.org/themes/split-me
If I click on first tab No.1 any link (preview mode active on both tabs) content shows from second No.2 tab to me. What happened? :)
Checked in Yandex.Browser (win) and Mozilla Firefox (linux)
Change History (19)
#2
@
11 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
I understand the current limitation, but the inability to preview two themes side by side seems counter-intuitive, especially when the core customizer already supports that.
Instead of relying just on the cookie initially set, can we pass the theme slug via an AJAX request when clicking on any link in the iframe, like the customizer does?
This ticket was mentioned in IRC in #wordpress-meta by sams. View the logs.
10 years ago
#5
@
10 years ago
Fwiw, this bug still exists with the new theme directory (not surprising) but now it shows Twenty Fifteen instead of showing the theme in tab 2.
#6
@
10 years ago
The previewer has not changed in how it operates under the hood. In redoing the preview data, I'll also look at this and see if a better method can be devised.
#10
follow-up:
↓ 11
@
6 years ago
- Keywords has-screenshots added
- Priority changed from low to normal
This is not just about seeing two themes at once, or as in #2943 saying it's Safari or as in #145 saying it's old IE.
I am using latest Firefox, and I get the default theme in the preview when clicking a link, whether I'm on the .org Theme page or in the admin Add New theme page. It could be something to do with the browser blocking 3rd party cookies.
#11
in reply to:
↑ 10
@
6 years ago
- Priority changed from normal to low
Replying to joyously:
I am using latest Firefox, and I get the default theme in the preview when clicking a link, whether I'm on the .org Theme page or in the admin Add New theme page. It could be something to do with the browser blocking 3rd party cookies.
@joyously That seems to have been a new behaviour and not related to this old ticket.
The cookie values have been ignored for the last ~4 weeks causing all clicks to switch back to the current default theme.
That's now been fixed (dotorg14318 for those with access).
Due to how it's currently working - using cookies, the original report of not being able to preview two themes at the same time is still valid and will require a rearchitecture of the previewer. That's unfortunately a low-priority at present.
#13
follow-up:
↓ 14
@
6 years ago
I think I've worked out a simpler solution by adjusting the type of URLs we use in the previewer.
Right now, the previewer uses basic default permalinks for everything:
https://wp-themes.com/?p=19
However, it uses this type of format to set the initial theme (and the cookie):
https://wp-themes.com/twentyfourteen/
If we change the base URL to that, and thus generate all internal links like this, as if it was in a subdirectory:
https://wp-themes.com/twentyfourteen/?p=19
Then we don't need the cookie anymore. Some adjustment of rewrites might be needed, but seems like it should work for any theme.
#14
in reply to:
↑ 13
@
6 years ago
Replying to Otto42:
If we change the base URL to that, and thus generate all internal links like this, as if it was in a subdirectory:
https://wp-themes.com/twentyfourteen/?p=19
I did try that, and didn't run into any issues at the time, simply stripping all the cookie handling and instead adding a pre_option_home
filter like this
function home() { return WP_HOME . '/' . $this->theme->get_stylesheet(); }
seems to works OK.
PHP combines the GET
parameters from the URL and the nginx rules and it was seemingly working fine.
I don't understand the alloptions
stuff, as far as I can see it's not even needed, so after stripping that all out i stopped there to avoid breaking something before figuring out what it was trying to do.
#15
@
6 years ago
The alloptions stuff is there to set the values correctly in the global alloptions values, so as to be the same as those in the theme object. It's not strictly necessary, but having it different than what is in the theme object caused undesirable behavior for some themes.
I'll do some tests with the home filtering, see if I can find any anomalies.
This ticket was mentioned in Slack in #themereview by dingo_d. View the logs.
5 years ago
#18
@
5 years ago
- Resolution set to fixed
- Status changed from assigned to closed
I've altered the Theme Previewer to rely upon the requested path rather than using cookies.
You should be able to open several themes side by side and navigate around without loosing the displayed theme now.
eg:
https://wp-themes.com/twentyten/
https://wp-themes.com/twentyseventeen/
https://wp-themes.com/twentytwenty/
The preview works by setting a cookie in your browser telling the site what theme you're previewing. When you load a different theme, then the cookies changes and now you're using another theme. Cookies go across your tabs.