Title: [Plugin: Category Meta plugin] Php help
Last modified: August 19, 2016

---

# [Plugin: Category Meta plugin] Php help

 *  [willvbcfc](https://wordpress.org/support/users/willvbcfc/)
 * (@willvbcfc)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-category-meta-plugin-php-help/)
 * I’m totally stuck with the php here, but I hope I’m being pretty clear with what
   I need and someone will kindly help me!
 * I’m using the following category loop to create a schedule for a radio station:
 *     ```
       <div id="showcatheaders"><img src="<?php bloginfo('template_url'); ?>/images/lunchtime_show_title.png" /></div>
   
                   <div id="lunchtimeshows">
       <?php
       $args=array(
         'orderby' => 'name',
         'order' => 'ASC'
         );
       $categories=get_categories('child_of=6');
         foreach($categories as $category) {
           echo '
             <div class="showboxtitle" style="background:url('. $category->description . ') no-repeat;">
             <a href="' . get_category_link( $category->term_id ) . '" class="nct" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a>
             </div>';
       } ?>
       ```
   
 * I’m calling up the category description for a background at the moment, but I
   would like to change that to a category meta called ‘catimg’.
 * I also need to display a day & time meta called ‘timeandday’ one line break after
   the category name within the div class named ‘showboxtitle’.
 * I’m totally stuck on how to modify the `if (function_exists('get_terms_meta')){
   $metaValue = get_terms_meta($category_id, $meta_key); }` template into this category
   loop, so please, please help!

Viewing 1 replies (of 1 total)

 *  [Robert](https://wordpress.org/support/users/robertjakobson/)
 * (@robertjakobson)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-category-meta-plugin-php-help/#post-1780537)
 * Theoritically this should work, however in practice, the plugin seems to be corrupt
   and not work all the time. Try inserting the following somewhere above:
 *     ```
       <?php if (function_exists('get_terms_meta')) {
       $category = get_the_category();
       $catid = $category[0]->cat_ID;
       $catimage = get_terms_meta($catid, 'catimg');
       $cattime = get_terms_meta($catid, 'timeandday');
       } ?>
       ```
   
 * In order to get the timeandday metadata to display as you desire, please add 
   this straight after the div “showboxtitle”
 * `<br/><p class="timeandday"><?php echo $cattime; ?></p>`
 * And replace the category description inside the style=””
    with `<?php echo $catimg;?
   >`
 * I will try to post an use-case scenario with an example wordpress template to
   [http://www.themesteam.com](http://www.themesteam.com) this week, if you are 
   interested!

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Category Meta plugin] Php help’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-category-meta.svg)
 * [Category Meta plugin](https://wordpress.org/plugins/wp-category-meta/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-category-meta/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-category-meta/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-category-meta/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-category-meta/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-category-meta/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Robert](https://wordpress.org/support/users/robertjakobson/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-category-meta-plugin-php-help/#post-1780537)
 * Status: not resolved