最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to copy a specific piece of the post to another page

programmeradmin2浏览0评论

Anyone know how to copy specific piece over of the_content(); of post, to another page distinguishing this content by post ID? I want to copy some gallery from each post to page gallery. Gallery code:

<?php $fields = CFS()->get( 'gallery' );
 foreach ( $fields as $field ) { ?>
<div class="single-row">
    <div class="row">
        <div class="single-image-gallery col-md-3 col-sm-12">
            <a href="<?php echo $field['add_img']; ?>" class="foobox" rel="gallery">
                <img src="<?php echo $field['add_img']; ?>" alt="<?php echo $field['alt1']; ?>">
            </a>

        </div>
        <div class="single-image-gallery col-md-3 col-sm-12">
            <a href="<?php echo $field['add_img2']; ?>" class="foobox" rel="gallery">
                <img src="<?php echo $field['add_img2']; ?>" alt="<?php echo $field['alt2']; ?>">
            </a>
        </div>
        <div class="single-image-gallery col-md-3 col-sm-12">
            <a href="<?php echo $field['add_img3']; ?>" class="foobox" rel="gallery">
                <img src="<?php echo $field['add_img3']; ?>" alt="<?php echo $field['alt3']; ?>">
            </a>

        </div>
        <div class="single-image-gallery col-md-3 col-sm-12">
            <a href="<?php echo $field['add_img4']; ?>" class="foobox" rel="gallery">
                <img src="<?php echo $field['add_img4']; ?>" alt="<?php echo $field['alt4']; ?>">
            </a>

        </div>
    </div>
</div>
<?php } ?>

发布评论

评论列表(0)

  1. 暂无评论