I think I know where the issue might be on your webpage click on the first item album. then look to the right of the picture that is the product short description
Album
$15.00
“This is a simple, virtual product.”
what is truncating is the first description and that one is not the one being feed to the home page.
ill be gone for a few hours will check back soon
again thank you
Ah I missed that. Sorry.
add_action( 'woocommerce_after_shop_loop_item_title', 'description_in_shop_loop_item', 3 );
function description_in_shop_loop_item()
{
global $post;
$limit = 24; //number of characters
$excerpt = $post->post_excerpt;
if (str_word_count($excerpt, 0) > $limit) {
$arr = str_word_count($excerpt, 2);
$pos = array_keys($arr);
$excerpt = substr($excerpt, 0, $pos[$limit]) . '';
}
echo '<span class="description"><p>' . $excerpt . '</p></span>';
}
-
This reply was modified 6 years, 10 months ago by
Stef.
ok that works part way it truncates but it duplicates the text if you look at the page you will see.
Because you have the other snippet in there. Take it out. Only use my last snippet.
This is all I have added after the basic function.php file
* Rename product data tabs
*/
add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tabs’, 98 );
function woo_rename_tabs( $tabs ) {
$tabs[‘additional_information’][‘title’] = __( ‘Specification / More Info.’ ); // Rename the additional information tab
return $tabs;
}
/**** truncate home page text */
add_action( ‘woocommerce_after_shop_loop_item_title’, ‘description_in_shop_loop_item’, 3 );
function description_in_shop_loop_item()
{
global $post;
$limit = 24; //number of characters
$excerpt = $post->post_excerpt;
if (str_word_count($excerpt, 0) > $limit) {
$arr = str_word_count($excerpt, 2);
$pos = array_keys($arr);
$excerpt = substr($excerpt, 0, $pos[$limit]) . ”;
}
echo ‘<span class=”description”><p>’ . $excerpt . ‘</p></span>’;
}
Like i said earlier. You probably have a snippet somewhere else because natively the Storefront theme doesn’t show this. If you do, delete it. As well as clear cache or use a private browser.
there is no snippet it is loaded via the powerpack from woo so I might have to change the way I do my home page. Thank you very much I will keep working on this till I can get it the way I like it.
If you have any opinion or suggestions on the site always open for direction. And again thank you
Can’t you turn that portion off? I haven’t used it in awhile.
Yes just found it buried in the customizer.
so how do I adjust to less text on the description? I would like to limit it to 2 lines of text if that is possible
I figured it out thank you the code said $limit = 25; //number of characters but it was words so I got it fixed.
It seems I have got all my questions figured out got lucky and found an article on the moving of the social media.
Do you have a paypal account I would like to send you some cash as a thank you,