This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Wiget output

Resolved 8 replies pluginplugin-page-builder
10 years ago · Last reply by Andrew Misplon 10 years ago

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.

Need fast email support? Get SiteOrigin Premium

Replies

8
  1. Greg Priday Staff 10 years, 9 months ago

    Hi Stivoox

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

    • stivoox 10 years, 9 months ago

      yes it works , but not in page builder

  2. Greg Priday Staff 10 years, 9 months ago

    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?

    • stivoox 10 years, 9 months ago

      Same thing for the other widgets

  3. Greg Priday Staff 10 years, 9 months ago

    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.

    • stivoox 10 years, 9 months ago

      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 ??

    • stivoox 10 years, 9 months ago

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

  4. Andrew Misplon Staff 10 years, 9 months ago

    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.

Have a different question or issue?

Start New Thread