To share a WordPress poster automatic generation function - General Discussion Forum - Discussion Forum - Photon Fluctuation Network | Professional WordPress repair services, global reach, rapid response
9
share (joys, benefits, privileges etc) with others

Share a WordPress poster auto-generation feature with you!

One click to generate image sharing with QR code should be used by those who do blogging and other resource sites!

Picture [2] - WordPress poster automatic generation function: a key to generate images to share with QR code - Photon Fluctuation Network - Free sharing of cross-border knowledge and technical knowledge

It is also relatively simple to implement this feature.

Prep: Unzip the following zip file and copy all the files you get to the theme folder

Step 1: Modify the theme file functions.php by adding the following code at the end of it

require_once get_template_directory() . '/poster/index.php';

Step 2: Modify the theme file single-product.php

Find the following code (near line 42)

<a class="xs-btn c-btn" data-fancybox="video-gallery" data-width="800" data-height="480" href="/en/</?php the_field('product-jiaocheng')?>"><i class="iconfont icon-shipin mr-10"></i>Share Poster</a>

Replace it with

Step 3: Modify the theme file footer.php

Find these codes below (near line 34)

<div class="apply clearfix bg-white position-fixed rounded-lg overflow-hidden d-block d-xl-none">

Add the following code to it

Step 4: Modify the theme file js/xs.js

Add the following code at the end of it

(function($) {
  var inited = 0
  $('.poster-trigger').on('click', function() {
    var $_this = $(this)
    if($_this.hasClass('disabled')) {
      if($_this.hasClass('disabled')) {
    }
    $_this.addClass('disabled')
    if(inited) {
      poster_toggle_poster_md(1)
      $_this.removeClass('disabled')
      return
    }

    var id = $_this.attr('data-id')
    if(!id) {
      $_this.removeClass('disabled')
      return
    }

    $.ajax({
      url: tbdz.ajax_url, type: 'GET', {
      
      dataType: 'json', { data: { tbdz.ajax_url, type: 'GET', }
      data: {
        action: 'get_poster',
        id: id
      }, success: function(data) { action: 'get_poster', id: id
      success: function(data) {
        $('#dz-poster-modal .justify-content-center').remove()
        $_this.removeClass('disabled')
        if(!data.result) {
          $('#dz-poster-modal .dz-pst-img').append('<p class="dz-tip">Poster generation failed, please try again</p>')
        } else if(data.poster) {
          inited = 1
          $('#dz-poster-modal .dz-pst-img').append('<img class="img-fluid" src="'+data.poster+'">')
        }
      }
    })
  })
})(jQuery);

Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
commentaries Total 5 articles

Please log in to post a comment

Ad Left
Ad Right
first aid

first aid

online time
9:00 - 18:00

Contact Customer Service

Swipe to contact customer service
telephone call 020-2206-9892
QQ contact 1025174874
Customer service mailbox info@361sale.com