Title: Need  code help
Last modified: August 22, 2016

---

# Need code help

 *  [bjsudipta](https://wordpress.org/support/users/bjsudipta/)
 * (@bjsudipta)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/need-code-help/)
 * I have a critical problem for integration woocommence in my custom created theme.
 * As per instruction, I already have created woocommerce.php file with save as 
   page of page.php.
 * Here is my **woocommece.php** page code
 * > <?php get_header(); ?>
   >  <?php include (TEMPLATEPATH . ‘/slider.php’); ?>
   >  <?php include (TEMPLATEPATH . ‘/newsletter.php’); ?>
   >  <div id=”main-container”>
   >  <div id=”container”>
   >  <div id=”content” role=”main” class=”woocommerce”>
   >  <?php woocommerce_content();?
   > > </div>
   >  </div>
   >  </div>
   >  <?php get_footer(); ?>
 * Here is my **function.php** file coding
 * > <?php
   >  register_nav_menus( array(
   >  ‘primary’ => __( ‘Top Navigation’, ‘sudipta’ ),
   >  ‘footermenu’ => __( ‘Footer
   > Navigation’, ‘sudipta’ ),
   >  ) );
   >  add_theme_support( ‘post-thumbnails’ );
   >  function show_avatar($comment, $size)
   >  { $email=strtolower(trim($comment->
   > comment_author_email)); $rating = “G”; // [G | PG | R | X] if (function_exists(‘
   > get_avatar’)) { echo get_avatar($email, $size); } else { $grav_url = “[http://www.gravatar.com/avatar.php?gravatar_id=](http://www.gravatar.com/avatar.php?gravatar_id=)”.
   > md5($emaill) . “&size=” . $size.”&rating=”.$rating; echo “<img src=’$grav_url’/
   > >”; } } function my_wp_trim_excerpt($text) { // Fakes an excerpt if needed 
   > if ( ” == $text ) { $text = get_the_content(”); $text = apply_filters(‘the_content’,
   > $text); $text = str_replace(‘]]>’, ‘]]>’, $text);
   >  // THEME MODIFICATION
   >  // Get the star html code preg_match(“/\<\/p\>.*?(\
   > <div.*?raterclear\”\>.*\<\/div\>.*\<\/div\>)/is”, $text, $matches); $starCode
   > = isset($matches[1])?$matches[1]:”; $text = str_replace($starCode, “”, $text);
   >  $text = strip_tags($text, ‘<p>’);
   >  $excerpt_length = 80; $words = explode(‘‘,
   > $text, $excerpt_length + 1); if (count($words) > $excerpt_length) { array_pop(
   > $words); array_push($words, ‘[…]’); $text = implode(‘ ‘, $words); } } // THEME
   > MODIFICATION – added ‘. $starCode’ return $text . $starCode; } remove_filter(‘
   > get_the_excerpt’, ‘wp_trim_excerpt’); add_filter(‘get_the_excerpt’, ‘my_wp_trim_excerpt’);
   >  add_theme_support(‘woocommerce’);
   >  ?>
 * **_But my problem is:
    1. I can’t add featured image of any product 2. How I 
   will modify CSS of my woocommece product page? Where I will get all id and classes?
 * Please help me quickly.
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

The topic ‘Need code help’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)
 * [woocommerce_content()](https://wordpress.org/support/topic-tag/woocommerce_content/)

 * 0 replies
 * 1 participant
 * Last reply from: [bjsudipta](https://wordpress.org/support/users/bjsudipta/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/need-code-help/)
 * Status: not resolved