• Resolved borkk85

    (@borkk85)


    Hi,

    I am using the Posts Widget, and trying to render post content that includes a and span tags, however unsuccessful with the excerpt option enabled. Is it possible at all to display the WYSIWYG edited post content this way? I would be grateful for any advice. Thanks.

    add_filter('elementor/widget/render_content', 'add_excerpt_link', 10, 2); 
    
    function add_excerpt_link($content, $widget) { 
        if ('elementor-widget-posts' !== $widget->get_name()) {
            return $content; 
        }
    
        $pattern = '/(<span class="original-price">.*?<\/span>)/i'; 
        $replacement = '<span style="font-weight: bold; font-style: italic;"><a href="..." target="_blank" rel="nofollow sponsored noopener">$1</a></span>'; 
        $new_content = preg_replace($pattern, $replacement, $content);
    
        return $new_content;
    }
    • This topic was modified 9 months, 2 weeks ago by borkk85.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Milos

    (@miloss84)

    Hi there,

    Currently, development/custom code queries (custom widgets and functions, Theme Child, custom code and CSS, BETA testing issues, compatibility issues, etc.) have to be directed to our GitHub project, where our developers will be able to assist.

    Kindly note that our GitHub project is not a support channel; therefore, the response times may vary. We appreciate your understanding.

    To post on our GitHub Repository, follow this guide: Contribution Guidelines.

Viewing 1 replies (of 1 total)
  • The topic ‘render content with widget posts’ is closed to new replies.