PageSourceSearch

https://setouchikappou-miyoshi.com/wp/wp-content/themes/ppr-original-child/js/script-instagram.js?ver=182304

js setouchikappou-miyoshi.com collected 2026-10-05 18:23:16 UTC 3,263 bytes, 68 lines download raw bytes

1jQuery(function($){
2
3  /* ----------------------------------------------------------------------
4  インスタ埋め込み instagram API ver7対応版
5  ---------------------------------------------------------------------- */
6    /* テンプレートURI読み込み -------------------------------*/
7        var wp_theme_uri = tmp_path.theme_uri; //子テーマ設置ディレクトリ呼び出し
8        var wp_home_url = tmp_path.home_url; //WPアドレス呼び出し
9
10    /* インスタの表示数制御 -------------------------------*/
11
12        //【1】スマホとPCで表示数が変わる場合はこちらのif文を使用
13        // if( $(window).width() < 767 ){
14        //   var photoLength  = 3;//スマホで表示する数
15        // } else {
16        //   var photoLength  = 6//PCで表示する数
17        // }
18
19        //【2】スマホとPCで表示数が変わらない場合はこちらを使用
20        var photoLength  = 6;//PC・スマホで表示する数
21
22
23    /* 複数ページに別々のアカウントのインスタを埋め込む場合はこちらを有効 -------------------------------
24        //実行ページのURLを取得
25        var url = location.href;
26
27        //ページ振り分け用 インスタごとにPHPファイルを準備してください
28        if (url.match(/aaa/)) {
29          var page = wp_theme_uri + "/php/instagramFeed-aaa.php";
30        }else if (url.match(/bbb/)) {
31          var page = wp_theme_uri + "/php/instagramFeed-bbb.php";
32        }else if (url.match(/ccc/)) {
33          var page = wp_theme_uri + "/php/instagramFeed-ccc.php";
34        }
35    */
36
37    /* 全ページ共通で1つのアカウントのインスタを埋め込む場合はこちらを有効 -------------------------------*/
38        var page = wp_theme_uri + "/php/instagramFeed.php";
39
40
41    /* 埋め込みスクリプト本体 -------------------------------*/
42    axios.get(page).then(function(instagram_data) {
43      console.log(instagram_data);// 検証ツールのConsoleを覗くと取得したデータの全容が確認できます。
44        
45      //他のInstagramビジネスアカウントの投稿情報も取得したい場合はこちらを有効
46      //const gallery_data = instagram_data["data"]["business_discovery"]["media"]["data"];
47
48      //自分のInstagramビジネスアカウントの投稿情報が取得できればOKな場合はこちらを有効
49      const gallery_data = instagram_data["data"]["media"]["data"];
50    
51      let photos = "";
52      const photo_length = photoLength;
53
54      for(let i = 0; i < photo_length ;i++){
55
56        if(gallery_data[i].thumbnail_url){
57        photos += '<li class="gallery-item"><a href="' + gallery_data[i].permalink + '" target="_blank" /><img src="' + gallery_data[i].thumbnail_url + '" loading="lazy" alt="' + gallery_data[i].caption + '" /></a></li>';
58        } else {
59        photos += '<li class="gallery-item"><a href="' + gallery_data[i].permalink + '" target="_blank" /><img src="' + gallery_data[i].media_url + '" loading="lazy" alt="' + gallery_data[i].caption + '" /></a></li>';
60        }
61      }
62
63      document.querySelector("#instaGallery").innerHTML = photos;
64    }).catch(function(error) {
65      console.log(error);
66    })
67
68});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.