Include plugin on theme

Support MB Show Hide Include plugin on theme

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1030
    lyosik1991lyosik1991
    Participant

    Hi. Help me please! How I can include plugin Meta Box Show Hide on my functions php?
    Thank you, best regards.
    Alona

    #1032
    Tan NguyenTan Nguyen
    Participant

    Hi Alona,

    Thanks for using our plugins.

    We wouldn't recommend you include plugin in theme, the reason is same as Include Meta Box Plugin In Themes/Plugins, you can use TGM Activation Class to tell users that your theme is required that plugin.

    But incase you really need to include plugin into your theme, here is the solution. Looks like you've already purchased MB Conditional Logic, so I'll use this plugin and twentyfifteen theme for example:

    1. Copy whole plugin directory to your theme, for example twentyfiteen/inc
    2. Open your functions.php, add this snippet to the last:

    
    if ( is_admin() )
    {
    	define( 'MBC_URL', get_template_directory_uri() . '/inc/meta-box-conditional-logic/' );
    	define( 'MBC_DIR', get_template_directory() . '/inc/meta-box-conditional-logic/' );
    
    	require MBC_DIR . '/meta-box-conditional-logic.php';
    }
    

    Or you can change inc directory to whatever you want.

    Best regards

    Tan Nguyen.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Include plugin on theme’ is closed to new replies.