douhao1956 2015-01-26 09:02
浏览 13

WordPress插件仅适用于父母和儿童主题?

I created a plugin called "plugin-1"

Plugin Name :plugin-1    
/*
 *
*/

if ( wp_get_theme() == 'theme-1') {
    //my plugin stuffs
}

And I have theme & child theme called "theme-1":

Theme Name : theme-1
Theme URI : theme-uri

And for eg "theme-1-child":

Theme Name : theme-1-child

The problem is I want to allow all my child themes to access the plugin "plugin-1"!!..

The case is my clients will create their own child but I need to allow to access the plugin!!

How can I do this? Kindly help me!!

  • 写回答

1条回答 默认 最新

  • donglengyuan6826 2015-01-26 11:59
    关注

    Try this:

    if ( wp_get_theme() == 'theme-1' || wp_get_theme() == 'theme-1-child') {
    //my plugin stuffs
    }
    
    评论

报告相同问题?