2

I have custom post types set up using CCTM plugin and I'm using the Bridge Theme by Qode.

The theme adds options to the posts and pages admin (custom theme options, title area, header etc.), I'm trying get the same options for the CCTM pages in the admin.

I've been through the functions.php for the theme but can't seem to figure out where it's being added to the posts/pages admin.

If any WP gurus could point me in the right direction it would be greatly appreciated. I can provide any further info if needed.

closed as off-topic by kaiser Dec 11 '14 at 14:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • It's poor development by the theme developers to hard-code the post types. Now you're forced to hack the theme or copy multiple files to a child theme. Disappointing – Marcus Christiansen Jan 23 '17 at 9:48
2

Theme uses custom meta boxes. If you go this path,

/wp-content/themes/bridge/framework/admin/meta-boxes

you will find folders. There is a map.php file in this folders. You can duplicate this folders and rename if you want to use for your CPT's.

Theme uses own metabox class QodeMetaBox when you duplicate files you need to change this code (for ex. i use SEO metabox);

$qodeSeo = new QodeMetaBox("page", "Qode SEO");
$qodeFramework->qodeMetaBoxes->addMetaBox("page_seo",$qodeSeo);

to:

$qodeSeo = new QodeMetaBox("post_type", "Qode SEO");
$qodeFramework->qodeMetaBoxes->addMetaBox("post_type_seo",$qodeSeo);

Where post_type is the string used as first parameter in register_post_type(), and post_type_seo is an unique string.

after that you need to include/call your new map file into qode-meta-boxes-setup.php after require_once("carousels/map.php");;

require_once("your-new-folder-name/map.php");

In addition to the above, the post_type needs to be added in the qode_meta_box_save function, so that the values will actually be saved to the database. Change framework\qode-framework.php on line 340:

$postTypes = array( "page", "post", "portfolio_page", "testimonials", "slides", "carousels");

to:

$postTypes = array( "page", "post", "portfolio_page", "testimonials", "slides", "carousels", "post_type");
  • Hi and many thanks for your answer. This works nicely except there are 5 different page types and it only seems to add the last require_once in the list in the qode-meta-boxes-setup.php. I've created each folder and updated the files appropriately. If I rearrange the list, it only works for the last one. Any ideas why that might be happening? – Rob McKinney Nov 4 '14 at 3:08
  • Interesting, if you change files properly script should work. Every post types has own folder and you create map.php files for each post types. When you add your own file as require_once, other post types (post,page,slider etc.) also had metaboxes, right? – Serkan Algur Nov 4 '14 at 8:47
  • Yeah, I've created 5 folders (audio, music, film, game, animation) with the map.php copied from page/map.php and all instances of "new QodeMetaBox("page".." changed to the appropriate page type ("audio", "music" etc.). All the Qode options are available in both posts & pages when there are no extra "required_once" but not available in pages when there are any extras added. Seems like there's a conflict in map.php? I can't see anything obvious though.. Thanks again for your help. – Rob McKinney Nov 4 '14 at 14:34
  • Probably you forget some changes in map.php files. If you add properly fore example require_once("audio/map.php");require_once("video/map.php"); Script should work for each post type. please double check the map.php files. – Serkan Algur Nov 5 '14 at 9:58
  • 1
    I've double & triple checked the map.php files. As long as the only things to change are the QodeMetaBox("post-type".. Then they are all correct. And they are added as you say, require_once("audio/map.php");require_once("video/map.php"); etc. it seems like the variables are being overwritten by each require but I would have thought the scope would be restricted to each file? It's very frustrating! Besides changing all the variables in each map.php, I can't think of anything else to do. – Rob McKinney Nov 5 '14 at 10:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.