Okay
  Public Ticket #2769226
Read more and read less button for single product page.
Closed

Comments

  • sharmin sultana started the conversation

    I want to remove read more and read less button for single product page

  •  2,634
    Kevin replied

    Hi sharmin sultana !

    Please provided your wp-admin account, I will check the details of the problem and help you adjust on the site

    thank you

  • sharmin sultana replied

    Could you please share me how can I fix it? It's my new client website.

  •  2,634
    Kevin replied

    Hi sharmin sultana !

    Go to Appearane-> Editor / inc / woo / hooks.php and update this file as below

  • sharmin sultana replied

    Will I paste all codes?

  • sharmin sultana replied

    I have used below of the code and now it's working. Thank You so much.

    <?php
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    // add_action( 'woocommerce_single_product_summary', 'ftc_template_single_excerpt', 5 );

    function ftc_template_single_excerpt(){
        $the_excerpt = get_the_excerpt('');
        $count_des = mb_strlen( $the_excerpt , 'UTF-8');
        if ($count_des >180){
            ?>
            <div class="ftc_excerpt">
              <div class="collapsed-content">     
                  <?php  global $more;
                  $temp = $more;
                  $more = false;
                  $short_description = get_the_excerpt('');
                  $short_descript = substr($short_description, 0, 180). '...';          
                  print_r($short_description);
                  $more = $temp;
                  ?>
              </div>
              <div class="full-content">
                  <?php   $full_description = the_excerpt(); ?>
              </div>
              <a href="#" id="readMore"><?php echo esc_html_e('Read more','peto') ?></a>
              <a href="#" id="readless" style="display: none"><?php echo esc_html_e('Read less','peto') ?></a>
          </div>
          <?php
      }
      else{
        echo  '<div class="collapsed-content">' ;
        echo '<p>'.$the_excerpt. '</p>';
        echo '</div>';
    }
    }

  •  2,634
    Kevin replied

    Hi sharmin sultana

    You're welcome!

    Please let us know if we can be of further assistance.

    If you're happy with the theme and support you received we would really appreciate it if you could leave us a good review and positive comment over on themeforest.

    It only takes a moment and really helps us to keep doing what we do best :)

    Just go to http://themeforest.net/downloads and click "Rate this item" under your theme.

    Many thanks in advance!