Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将图像放置在帖子内容之间_Php_Wordpress_Wordpress Theming - Fatal编程技术网

Php 将图像放置在帖子内容之间

Php 将图像放置在帖子内容之间,php,wordpress,wordpress-theming,Php,Wordpress,Wordpress Theming,我在wordpress网站上工作,我的问题是我想在每个段落后的帖子内容中放置三张图片。我知道这可以通过使用wordpress提供的文本编辑器来完成,但几天后我们将更改图像,在我的博客中,我有50多篇文章,我不想继续每篇文章,更改图像,因为这很耗时。那么,有没有代码,我可以把所有的三张图片的图片放在每一副伞后面。这是我在主题中找到的代码 <div class="<?php echo implode( ' ', apply_filters( 'hu_single_entry_class'

我在wordpress网站上工作,我的问题是我想在每个段落后的帖子内容中放置三张图片。我知道这可以通过使用wordpress提供的文本编辑器来完成,但几天后我们将更改图像,在我的博客中,我有50多篇文章,我不想继续每篇文章,更改图像,因为这很耗时。那么,有没有代码,我可以把所有的三张图片的图片放在每一副伞后面。这是我在主题中找到的代码

<div class="<?php echo implode( ' ', apply_filters( 'hu_single_entry_class', array('entry','themeform') ) ) ?>">
    <div class="entry-inner">
     <?php the_content(); ?>
</div>
</div>
<div class="<?php echo implode( ' ', apply_filters( 'hu_single_entry_class', array('entry','themeform') ) ) ?>">
    <div class="entry-inner">
     <?php the_content(); ?>
<img src="imagelink here" alt="" height="" width="">
<img src="imagelink here" alt="" height="" width="">
<img src="imagelink here" alt="" height="" width="">
</div>
</div>

您必须将图像放在内容之后。因此,请像这样将图像放在
之后

编辑single.php

如果您想在每篇文章中添加常见的3个图像(即'single.php`)
那么你可以这样用

问题是图像必须放在内容的中间。如何做。当你发帖时,你所有的帖子都会以一个文件的形式在一列中进入mysql数据库。因此,当您通过
调用_content()
函数调用post时,它将从数据库中调用您的post。所以从技术上讲,你不能在那篇文章之间放任何其他东西。VIpin,这不是我的解决方案。我想在内容之间插入图像。
If you want add common 3 images on every post (i.e `single.php`)

    then you can use like this

    <div class="<?php echo implode( ' ', apply_filters( 'hu_single_entry_class', array('entry','themeform') ) ) ?>">
        <div class="entry-inner">
         <?php the_content(); ?>
    <a href=""><img class="img-responsive" src="" alt=""></a>
    <a href=""><img class="img-responsive" src="" alt=""></a>
    <a href=""><img class="img-responsive" src="" alt=""></a>
    </div>
    </div>

    If you want change the images in future so you can change the path here.

    If you want different images on each post so you can do it by suing advance custom field (`ACF`)

    Link- https://wordpress.org/plugins/advanced-custom-fields/

    By using create field and fetch on `single.php` page

    for fetching image use 

    <?php $field = get_field($field_name, $post_id, $format_value); ?>

    I hope this will help you.

    Thank you.
i think you can do this by using Advance custom field. (ACF)

    Steps find below:

    1.create a field for content (the content before image) on single .php
    2.create image field by using ACF or reapter field and fetch in on single.php page
    3.create a field for content(the content after images) on single .php

    You can fetch both the conetnt field and images here so for every post you have to ad content but for images you can chnages the images once so it will reflect to your all post.

    I hope this will you.

    Thank you