스타일 --
.owl-nav{ text-align: center; font-size: 28px; margin: -30px; visibility: hidden; }
php 입력 --
add_stylesheet('', 0); $tagetedInstaUrl = 'https://www.instagram.com/hillsong/'; $data = file_get_contents($tagetedInstaUrl); if (preg_match('#_sharedData = (.*);</script#', $data, $m)) { $json = json_decode($m[1], 1); if(!$json) {die ("Can't decode json.");} $ppage = $json['entry_data']['ProfilePage']; $edges = $ppage[0]['graphql']['user']['edge_owner_to_timeline_media']['edges']; echo '
'; foreach ($edges as $edge) { $node = $edge['node']; $image = $node['thumbnail_src']; $shortcodeForEachPictureUrl = $node['shortcode']; echo '
'; echo ''; echo ''; } echo '
'; }
스크립트 입력 --
var owl = $('.owl-carousel'); $('.owl-carousel').owlCarousel({ margin:10, autoplay:true, loop:true, responsiveClass:true, responsive:{ 0:{ items:1, nav:true }, 600:{ items:3, nav:true }, 1000:{ items:5, nav:true } } }); owl.on('mousewheel', '.owl-stage', function (e) { if (e.deltaY>0) { owl.trigger('next.owl'); } else { owl.trigger('prev.owl'); } e.preventDefault(); });
인스타아이디만 있으면 가져온다
티스토리 줄바꿈 안되서가져오네..으 깔끔하게 어떻게 가져오나