• I downloaded the CMB2 from Github and uploaded it to plugins. The structure became wp-content/plugins/cmb2/

    After activating it, it said it has an update, I updated it.

    I then copied example-functions.php, filtered what I needed and created functions.php in cmb2 directory and pasted the filtered code there.

    But it just does not show on ‘page’.

    I tried adding and removing following code as well, but that too didn’t help.

    if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
    	require_once dirname( __FILE__ ) . '/cmb2/init.php';
    } elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
    	require_once dirname( __FILE__ ) . '/CMB2/init.php';
    }

    PS. Am on latest WP version and Genesis 2.2

    https://www.ads-software.com/plugins/cmb2/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Alright, so you have it installed as a plugin instead of a standalone directory. Have you activated the plugin at all? If I’m following your structure correctly, none of it is getting loaded yet because it’s not referenced in any files that are already loaded. They’re just files on the server.

    It should kick in once you’ve activated the plugin, and you wouldn’t need the if statement above because the init.php file would already be loaded via the plugin.

    Thread Starter Vajrasar Goswami

    (@vajrasar)

    Yes. I’ve activated the plugin.

    Also, as I was pointed out by someone, I tried to make a metabox.php file into theme’s directory and used following in functions.php–>

    include_once( get_stylesheet_directory_uri() . ‘/metabox.php’ );
    but this throws the error –>

    Fatal Error: Call to an undefined filter in line 2 in metabox.php

    The line is 2 is –>
    add_filter( ‘cmb2_meta_boxes’, ‘cmb2_page_metaboxes’ );

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Would you be willing to let me into the admin side of things for your site, assuming the site is not a localhost install?

    I’m curious about some details.

    Thread Starter Vajrasar Goswami

    (@vajrasar)

    Sure. How can I send you the details.

    Thread Starter Vajrasar Goswami

    (@vajrasar)

    Hey. Michael.

    With the help of one of the dev, when I used –

    require( get_stylesheet_directory() . '/metabox.php' );

    it worked.

    I used that line in functions.php and dumped all the filtered code (that I wanted) into the metabox.php in theme’s directory.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    So you’re good to go now? ??

    Sounds like you may be.

    Thread Starter Vajrasar Goswami

    (@vajrasar)

    Yeah. Thanks for replies.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CMB2 not showing on object type’ is closed to new replies.