0

I have a custom taxonomy 'issue'. I tried to add some meta fields to the add/edit issue pages in the dashboard using the method explained by Ohad Raz (https://en.bainternet.info/wordpress-taxonomies-extra-fields-the-easy-way/). So i downloaded the files from github (https://github.com/bainternet/Tax-Meta-Class), put them in the child theme folder & add these lines to child theme functions.php:

require_once( get_stylesheet_directory() . '/Tax-meta-class/Tax-meta-class.php' );

$config = array(
   'id' => 'demo_meta_box',
   'title' => 'Demo Meta Box',
   'pages' => array('issue'),
   'context' => 'normal',
   'fields' => array(),
   'local_images' => false,
   'use_with_theme' => false
);
$my_meta = new Tax_Meta_Class($config);
$my_meta->addText('text_field_id',array('name'=> 'My Text '));
$my_meta->addTextarea('textarea_field_id',array('name'=> 'My Textarea '));
$my_meta->addDate('date_field_id',array('name'=> 'My Date '));
$my_meta->addImage('image_field_id',array('name'=> 'My Image '));
$my_meta->addFile('file_field_id',array('name'=> 'My File '));
$my_meta->Finish();

So, now all fields are added to the add/edit taxonomy dashboard page. But, without the css style. Although there is a css file in the tax-meta-class folder/css, fields added to the dashboard have no style, even add image/add file buttons don't open, date picker is displayed as a normal text field. I couldn't figure out how to apply the css code on those created fields. Can you help me please?

0

After reviewing the code more & more I found the solution. So, for those who have interest in such thing:

  1. change false to true in use_with_theme
  2. change template path to stylesheet path in tax-meta-class.php

Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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