Welcartの商品画像をカスタム投稿タイプで出力したい
-
カスタム投稿タイプ「news」の記事詳細ページ(single-news.php)に、プラグイン「Custom Field Suite」の「関連ポスト」で選択した商品の画像を掲載したいです。
usces_the_itemImage() では出力できませんでした。アドバイスを頂けないでしょうか。▼環境など
- WordPress 5.4.2
- Welcart e-Commerce 1.9.31
- Custom Field Suite 2.6
▼試したこと
- <?php usces_the_itemImage(); ?> で呼び出し
▼書いたコード
※フィールドの名前が recommend_ite<?php $values = CFS()->get('recommend_item'); foreach ($values as $post_id): setup_postdata( $post_id ); $rslink = get_permalink($post_id); $rstitle = get_the_title($post_id); ?> <p> <a href="<?php echo $rslink ?>"> <?php echo $rstitle ?> </a> <figure><?php usces_the_itemImage(); ?></figure> </p> <?php endforeach; ?>
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「Welcartの商品画像をカスタム投稿タイプで出力したい」には新たに返信することはできません。