New Landing How can we help? Themeforest Theme Support Neighborhood How to shorten product titles in Latest Products and all such widgets ?

Viewing 12 posts - 1 through 12 (of 12 total)
  • #231043
    Shashank_IN
    Member
    Post count: 51

    Trying to restrict number of words and slash them out ! this is to make the Product description layout good and the price of product stays in line with title of product.Tried following code,no help

    //filter to limit WordPress Product Title
    add_filter( ‘the_title’, ‘shorten_woo_product_title’, 10, 2 );
    function shorten_woo_product_title( $title, $id ) {
    if ( is_shop() && get_post_type( $id ) === ‘product’ ) {
    return wp_trim_words( $title, 4 ); // change last number to the number of WORDS you want
    } else {
    return $title;
    }
    }
    // ends here

    #231269
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this custom css code:-

    .woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 {
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
    }
    
    ul.products li.product .product-details{
    width:100% !important;
    }

    Thanks
    Mohammad

    #231510
    Shashank_IN
    Member
    Post count: 51

    That worked fine but price of product still floats in Air.Kindly check New Arrivals DIV pls.
    Didn’t work for products in Top Products div located below “Free international shipping! offer ends May 20th 2013”.
    Please help!

    #231514
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please attach marked screenshot to indicate the issue.
    Thanks
    Mohammad

    #231522
    Shashank_IN
    Member
    Post count: 51

    #1 Price of product still floats in Air.Kindly check New Arrivals DIV pls.
    #2 Didn’t work for products in Top Products div located below “Free international shipping! offer ends May 20th 2013”.
    #3 How to remove all HTTPS non secure to my own server?

    Attachments:
    You must be logged in to view attached files.
    #231553
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    1- Where do you want to align price?

    2- Please use this custom css code:-

    .mini-list li h5 {
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    3- Please use the wordpress HTTPS plugin.

    Thanks
    Mohammad

    Thanks
    Mohammad

    #231562
    Shashank_IN
    Member
    Post count: 51

    #1 Along the title! And want to remove the Category name instead let title come in two lines. Can this be done?

    #231588
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Change

    ul.products li.product .product-details{
    width:100% !important;
    }

    to

    ul.products li.product .product-details{
    width:60% !important;
    }

    and add this:

    ul.products li.product .product-details a {
      white-space: pre-line;
    }

    – Kyle

    #231687
    Shashank_IN
    Member
    Post count: 51

    Regarding the length of title of widgets it’s still persistent inspite of addding below code:

    .woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 {
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    }

    Please find the attachment.Error 1 and kindly ignore another attached file.My bad!

    I just want to show few words possibly 3 and then ellipsis to be shown everywhere across the site and widgets.

    Attachments:
    You must be logged in to view attached files.
    #231698
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    You said you want the text to go on to a second line? Do you want that or 1 line and ellipsis?

    – Kyle

    #231701
    Shashank_IN
    Member
    Post count: 51

    My bad. Want to trim it in Line 1.

    #231702
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ok just remove:

    ul.products li.product .product-details a {
      white-space: pre-line;
    }

    From your custom css

    – Kyle

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register