• 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=
    ” . 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/

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