ワンクリックで写真共有バンドのQRコードを生成することは、ブログや他のリソースサイトを行う人が使用する必要があります!
![画像[2]-WordPressのポスター自動生成機能:QRコードで共有する画像を生成する鍵 - 光ゆらぎネットワーク - 国境を越えた知識・技術知識を無料で共有しよう](https://www.361sale.com/wp-content/uploads/2024/04/image-526.png)
この機能を実装するのも比較的簡単です。
準備:以下のzipファイルを解凍し、テーマフォルダに入手したファイルをすべてコピーする。
ステップ1:テーマファイルfunctions.phpを修正し、その末尾に以下のコードを追加する。
require_once get_template_directory() . '/poster/index.php';
ステップ2:テーマファイルsingle-product.phpを修正する
次のコード(42行目付近)を見つけてください。
<a class="xs-btn c-btn" data-fancybox="video-gallery" data-width="800" data-height="480" href="/ja/</?php the_field('product-jiaocheng')?>"><i class="iconfont icon-shipin mr-10"></i>シェアポスター</a>
と置き換える。
ステップ3:テーマファイルfooter.phpを修正する
以下のコードを見つけてください(34行目付近)
<div class="apply clearfix bg-white position-fixed rounded-lg overflow-hidden d-block d-xl-none">
そこに以下のコードを追加する。
ステップ4:テーマファイルjs/xs.jsを修正する
その最後に以下のコードを追加する。
(function($) {)
var inited = 0
$('.poster-trigger').on('click', function() {)
var $_this = $(this)
if($_this.hasClass('disabled')) { { $_this.hasClass('disabled'))
if($_this.hasClass('disabled')){。
}
$_this.addClass('disabled')
if(inited) { } $_this.addClass('disabled')
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', { } $.ajax({
dataType: 'json', { data: { tbdz.ajax_url, type: 'GET', }.
data: {
action: 'get_poster'、
id: id
}, success: function(data) { action: 'get_poster', id: id
成功: 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">ポスター生成に失敗しました。</p>')
} else if(data.poster){。
inited = 1
$('#dz-poster-modal .dz-pst-img').append(')<img class="img-fluid" src="'+data.poster+'">')
}
}
})
})
})(jQuery);
| お問い合わせ | |
|---|---|
| チュートリアルが読めない?無料でお答えします!個人サイト、中小企業サイトのための無料ヘルプ! |
カスタマーサービス WeChat
|
| ① 電話:020-2206-9892 | |
| ② QQ咨询:1025174874 | |
| 三 Eメール:info@361sale.com | |
| ④ 勤務時間: 月~金、9:30~18:30、祝日休み | |



- 最新
- ホット
著者のみご覧ください。