0

I add this code in my php file:

<script type='text/javascript'>if(typeof wabtn4fg===&quot;undefined&quot;){wabtn4fg=1;h=document.head||document.getElementsByTagName(&quot;head&quot;)[0],s=document.createElement(&quot;script&quot;);s.type=&quot;text/javascript&quot;;s.src=&quot;https://cdn.jsdelivr.net/whatsapp-sharing/1.3.4/whatsapp-button.js&quot;;h.appendChild(s);}</script>
<a class='wa_btn wa_btn_l' expr:data-href='data:post.url' expr:data-text='data:post.title' href='whatsapp://send' style='display:none'>Share this Article!</a>

But is not showing. Full code:

<div class="article-header">
                                        <img src="images/news/<?php echo $news['photo']; ?>" class="article-photo" alt="" />
                                        <div class="article-meta">
                                            <div class="meta-date">
                                                <span class="date"><?php echo substr($news['tanggal'],8,2) ?></span>
                                                <span class="month"><?php echo substr($news['tanggal'],5,2)?>, <?php echo substr($news                      ['tanggal'],0,4) ?> </span>
                                                <span class="author">by <a href="#"><?php echo $news['penulis']; ?></a></span>
                                                </div>
                                                <script type='text/javascript'>if(typeof wabtn4fg===&quot;undefined&quot;){wabtn4fg=1;h=document.head||document.getElementsByTagName(&quot;head&quot;)[0],s=document.createElement(&quot;script&quot;);s.type=&quot;text/javascript&quot;;s.src=&quot;https://cdn.jsdelivr.net/whatsapp-sharing/1.3.4/whatsapp-button.js&quot;;h.appendChild(s);}</script>
<a class='wa_btn wa_btn_l' expr:data-href='data:post.url' expr:data-text='data:post.title' href='whatsapp://send' style='display:none'>Share this Article!</a>
                                                <div class="meta-tools">
                                                <span><i class="fa fa-text-height"></i>Ukuran Font <span class="f-size"><a href="#font-size-down">-</a><span class="f-size-number">16</span><a href="#font-size-up">+</a></span></span>
                                            </div>
                                        </div>
                                    </div>
1
  • am I in blacklist? views by 11
    – King Tyga
    Jul 16, 2020 at 2:28

1 Answer 1

1

In your <script> tag replace all the &quot;s with '.

Also the script only works on mobile devices. It checks the user agent on load and will only display if the users device is android or ios.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.