How to hide WooCommerce product title and short description to non logged in users?

Your $description is shown because you concatenated it is your condition in $description = ‘ ‘ . sprintf( __( “To check if this item qualifies for a discount %s an account.”), ” . __(“Log In or Create”) . ” ) . ‘ ‘ . $description; Does the below code helps ? add_filter( ‘woocommerce_short_description’, ‘add_text_before_short_description_for_guests’ ); … Read more

Custom blog post summary on blog index page

I think the easiest way is using the Excerpt field in the editor or add a custom field to enter your summary and then filter https://developer.wordpress.org/reference/hooks/the_excerpt/ to return the right text. Because recognizing automatically the right div will force to parse HTML, and it’s more complicated.