【问题标题】:How to use multiple buddypress mobile themes如何使用多个 buddypress 移动主题
【发布时间】:2012-12-21 10:53:00
【问题描述】:

如何在 buddypress 移动版中使用多个主题,我想在这些主题之间快速切换。这是为了创建样式和测试主题。同时比较这些主题。

【问题讨论】:

    标签: wordpress mobile wordpress-theming buddypress


    【解决方案1】:

    创建一个文件/wp-content/sunrise.php。在那里你可以这样写:

    add_filter('option_template', 'filter_get_option');
    add_filter('option_stylesheet', 'filter_get_option');
    function filter_get_option($value){
        // here you can based on url or any other thing 
        // change the theme on a fly, like this:
        if(true){
            $value = 'theme_1';
        }else{
            $value = 'theme_2';
        }
    
        return $value;
    }
    

    这有点像 hack,但它确实有效。 theme_1theme_1 是主题文件夹(/wp-content/themes/ 内的那些文件夹

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-11
      • 2014-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-08
      相关资源
      最近更新 更多