Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minileven: can't load custom theme with jetpack_mobile_template or jetpack_mobile_stylesheet #2061

Closed
jeherve opened this issue Apr 30, 2015 · 3 comments · Fixed by #14714
Closed
Labels
[Feature] Mobile Theme aka minileven Good For Community [Pri] Low [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@jeherve
Copy link
Member

jeherve commented Apr 30, 2015

Jetpack's Mobile Theme detection includes 2 filters, jetpack_mobile_template and jetpack_mobile_stylesheet, that allow you to define a custom Mobile Theme instead of the default Minileven:

function jetpack_mobile_stylesheet( $theme ) {

Unfortunately, the custom theme still has to be located inside the Minileven module directory. It would be nice if you could use the filters to load a theme from the /themes directory, or from another plugin.

Reported here:
https://wordpress.org/support/topic/custom-mobile-theme-1

@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Mobile Theme aka minileven labels Apr 30, 2015
@samhotchkiss samhotchkiss modified the milestone: Needs Triage Aug 28, 2015
@samhotchkiss
Copy link
Contributor

Makes sense, but isn't in line with our current goals for Jetpack and isn't high priority enough to focus on right now. Would be open to PRs from the community addressing this.

@samhotchkiss samhotchkiss modified the milestones: Community, Needs Triage Nov 4, 2015
@samhotchkiss samhotchkiss removed the [Type] Bug When a feature is broken and / or not performing as intended label Nov 4, 2015
@kraftbj kraftbj added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Nov 30, 2015
@samhotchkiss samhotchkiss modified the milestones: Community, Not Currently Planned Feb 10, 2017
@megamurmulis
Copy link

Losing code changes on each update is obviously bad, so should store mobile theme in uploads or themes dir..

But I can confirm that this workaround is working:
1. If your mobile Jetpack theme is located in /wp-content/themes/mytheme_mobile/
2. Create a new plugin: jetpack_custom_theme_location.php

<?php
/*
Plugin Name: Jetpack custom mobile theme location
Description: Set custom Jetpack mobile theme location
Version:     1.0.0
*/
add_filter( 'jetpack_mobile_stylesheet', function( $stylesheet, $theme ) {
	return '../../../../../themes/mytheme_mobile';
}, 10, 2);
add_filter( 'jetpack_mobile_template', function ( $template, $theme ) {
	return '../../../../../themes/mytheme_mobile';
}, 10, 2);

It does however mean that URLs in css and JS output will be:
http://domain.com/devdorado/wp-content/plugins/jetpack/modules/minileven/theme/../../../../../themes/mytheme_mobile/style.css..

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Mobile Theme aka minileven Good For Community [Pri] Low [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants