Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1130231
    Philip M
    Participant

    Hi Guys,
    is there any way to stop the shortcode text from appearing in my product feed (it’s for for Google Shopping) when using the Short Description box?

    I use the product short description with this shortcode – [x_alert type=”success”]My description here.[/x_alert].

    The shortcode appears in Visual mode as well as Edit mode, which doesn’t happen with other text enhancements, so I’m not too hopeful, but thought I’d ask anyway.

    Thank you.

    #1130484
    Christopher
    Moderator

    Hi there,

    Please provide us with URL of page in question and login credentials so we can take a closer look.

    Thanks.

    #1130649
    Philip M
    Participant
    This reply has been marked as private.
    #1130679
    Thai
    Moderator

    Hi Philip,

    Please add the following code under functions.php file locates in your child theme:

    add_filter('the_excerpt_rss', 'x_custom_feed');
    add_filter('the_content', 'x_custom_feed');
    function x_custom_feed( $content ) {
    	global $post;
    
    	if ( ! is_feed() )
    		return $content;
    
    	// Remove all shortcodes
    	$content = strip_shortcodes( $post->post_content );
    	return $content;
    }

    Hope it helps 🙂

    #1130731
    Philip M
    Participant

    Hello Thai,
    thanks for the quick response.
    I added that and regenerated the feed, but unfortunately the shortcode text is still showing as before.

    My products are added as products with WooCommerce, not posts, is it something to do with that?

    Thanks again,
    Philip.

    #1130761
    Christian
    Moderator

    Hey Philip,

    Sorry for the confusion. This requires filtering of the WooCommerce short description content. Regretfully, this would need custom development which regretfully falls outside the scope of our support. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/. This article might also help.

    Thank you for understanding.

    #1130794
    Philip M
    Participant

    Hi Christian,
    ah, that’s a pity.
    Thanks anyway,
    Philip.

    #1130824
    Rupok
    Member

    You are welcome Philip!

    #1131058
    Philip M
    Participant

    Hi,
    just thinking, if I could change the background colour of the Product Short Description box on the front end, that would be nearly the same as what I’m doing with the shortcode. Then I could remove the shortcode.
    Is that something I could with some CSS?
    I know it would apply to every product on the site then, but that’s no problem.
    Thanks again,
    Philip.

    #1131326
    Rue Nel
    Moderator

    Hello There,

    To resolve your issue and change the background color of the product short description box, please add the following css code in the customizer, Appearance > Customize > Custom > CSS

    div[itemprop="description"] {
        padding: 15px;
        background-color: #e5e5e5;
    }
    
    div[itemprop="description"] p{
        margin-bottom: 0;
    }

    Hope this helps.

    #1131641
    Philip M
    Participant

    Hi Rue Nel,
    that’s great, it did the trick. I wish I had thought of it sooner, would have saved me loads of work 🙂
    Thank you and best regards,
    Philip.

    #1131661
    Thai
    Moderator

    You’re most welcome 🙂

    If you need anything else please let us know.

  • <script> jQuery(function($){ $("#no-reply-1130231 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>