UT PortfolioでInstagram

Pocket

だいぶニッチで限定的な内容ですが、今後使いそうなので書いておく。
WordPressのUnited Themesを使い、UT PortfolioでInstagramの写真を掲載する方法。さらに、クリックしたらExternal linkとしてInstagramのページへ飛ぶようにする。
Requirements:

やること
Portfolio Management by United Themesプラグインを編集する。Filterを使ってもできるかもしれないけど、プラグインを直接編集する方法で。
dsgnwrks=instagram-importer/dsgnwrks-instagram0importer.php を編集
line 1045の、savePostmeta()の中身を

		foreach ( array(
			'dsgnwrks_instagram_likes'    => $this->pic->likes,
			'dsgnwrks_instagram_comments' => $this->pic->comments,
			'dsgnwrks_instagram_hashtags' => $this->pic->tags,
			'instagram_created_time'      => $this->pic->created_time,
			'dsgnwrks_instagram_id'       => $this->pic->id,
			'instagram_filter_used'       => $this->pic->filter,
			'instagram_attribution'       => $this->pic->attribution,
			'instagram_location'          => $this->pic->location,
			'instagram_users_in_photo'    => $this->pic->users_in_photo,
			'instagram_link'              => esc_url( $this->pic->link ),
			'instagram_embed_code'        => $this->instagram_embed(),
			'instagram_type'              => $this->pic->type,
			'instagram_user'              => $this->pic->user,
			'instagram_username'          => $this->pic->user->username,
            // 追記
            'ut_portfolio_link_type'  => 'external',
            'ut_external_link'        => esc_url( $this->pic->link ),
            // 追記ここまで
		) as $key => $value ) {
			update_post_meta( $this->import['post_id'], $key, $value );
		}
        // 追記
        // set category
        wp_set_post_terms( $this->import['post_id'], 'instagram', 'portfolio-category', true );
        // 追記 ここまで

 
に編集。
 

Comments on this post

No comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

Trackbacks and Pingbacks on this post

No trackbacks.

TrackBack URL