简体   繁体   中英

How can add this type is a code to convert Wordpress shortcode?

I need to add this type code convert wordpress shortcode. Have any WordPress Plugin?

<ins class="bookingaff" data-aid="1316333" data-target_aid="" data-prod="rw" data-width="0" data-height="0" data-lang="en-US" data-show_rw_badge="1" data-show_rw_text="1" data-hid="56423">
    <!-- Anything inside will go away once widget is loaded. -->
    <a href="//www.booking.com?aid=">Booking.com</a>
</ins>
<script type="text/javascript">
    (function(d, sc, u) {
      var s = d.createElement(sc), p = d.getElementsByTagName(sc)[0];
      s.type = 'text/javascript';
      s.async = true;
      s.src = u + '?v=' + (+new Date());
      p.parentNode.insertBefore(s,p);
      })(document, 'script', '//aff.bstatic.com/static/affiliate_base/js/flexiproduct.js');
</script>

If I understand correctly you are asking to turn the snippet above into a shortcode. If that is what you're looking for you could use a plugin like Snippy (disclaimer, I'm the author of the said plugin).

With Snippy you can create custom shortcodes without having to modify PHP files.

Create a new Snippy "bit" and copy the above HTML snippet to the value field, then add the "bit" to your very own [bookingaff] shortcode. If needed you can add placeholders to the HTML snippet for values you might want to change per page. There's more information to be found on the Snippy product page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM