Home>Support>Wiget output

Wiget output

Hi , I created a custom widget for siteorigin page builder for my theme , but it’s output without any html markup and any css style , and all my variables are surrounded with p tag .
any idea ??

    public function widget($args, $instance) {
        extract($args);
        echo $args['before_widget'];

        $title = empty($instance['title']) ? '' : $instance['title'];
        $mymail = empty($instance['mymail']) ? '' : $instance['mymail'];
        $mytel = empty($instance['mytel']) ? '' : $instance['mytel'];
        $mydescription = empty($instance['mydescription']) ? '' : $instance['mydescription'];
        $freelance = empty($instance['freelance']) ? false : $instance['freelance'] === "YES";
        $maplati = empty($instance['maplati']) ? '' : $instance['maplati'];
        $maplong = empty($instance['maplong']) ? '' : $instance['maplong'];
        $adresse = empty($instance['adresse']) ? '' : $instance['adresse'];
        $img_bg = empty($instance['img_bg']) ? '' : $instance['img_bg'];


        echo $before_title . $title . $after_title;
        ?>
        <div class="about-card">
            <div class="face2 card-face">
                <div id="cd-google-map">
                    <div id="google-container"></div>
                    <div id="cd-zoom-in"></div>
                    <div id="cd-zoom-out"></div>
                    <address><?php echo $adresse; ?></address>
                    <div class="back-cover" data-card-back="data-card-back"><i class="fa fa-long-arrow-left"></i>
                    </div>
                </div>
            </div>
            <div class="face1 card-face">
                <div class="about-cover card-face">
                    <a class="map-location" data-card-front="data-card-front"><img src="images/map-icon.png" alt="">
                    </a>
                    <div class="about-details">
                        <div><span class="fa fa-inbox"></span><span class="detail"><?php echo $mymail; ?></span>
                        </div>
                        <div><span class="fa fa-phone"></span><span class="detail"><?php echo $mytel; ?></span>
                        </div>
                    </div>

                    <div class="cover-content-wrapper">
                        <span class="about-description"><?php echo $mydescription; ?></span>
                        <?php
                        if ($freelance == 'YES') {
                            echo '<span class="status">';
                            echo '<span class="fa fa-circle"></span>';
                            echo '<span class="text">Available as <strong>freelance</strong></span>';
                            echo '</span>';
                        }
                        ?>
                    </div>
                </div>
            </div>
        </div>

        <?php
        echo $args['after_widget'];
    }

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 4 months ago Greg Priday
    Hi, I Work Here

    Hi Stivoox

    Have you checked that your widget is working in a standard WordPress widget area?

    • 9 years, 4 months ago stivoox

      yes it works , but not in page builder

  2. 9 years, 4 months ago Greg Priday
    Hi, I Work Here

    Is this issue specific to your own widget, or do you get a similar issue with other widgets? Can you try inserting widgets from the SiteOrigin Widgets Bundle?

    • 9 years, 4 months ago stivoox

      Same thing for the other widgets

  3. 9 years, 4 months ago Greg Priday
    Hi, I Work Here

    This might be related to filters on the_content within your theme or any other plugins.

    You can try activating a default WordPress theme like Twenty Twelve to rule out any conflicts coming from within your theme. If that doesn’t help, then disabling other plugins might help you isolate where the conflict is coming from.

    • 9 years, 4 months ago stivoox

      yes that’s true i use ( echo $content ) to show the content of my pages , and this can’t show the content with style of widget page builder . any idea ??

    • 9 years, 4 months ago stivoox

      I finally found the soulution by using the_content () instead of apply_filters (‘the_content’, $ page_data-> post_content) . tnx for your support

  4. 9 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Hi stivoox

    Really glad to hear you’ve made progress on this. Thanks for sharing your solution and keeping this thread updated.

    All the best with your project.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More