php - 想知道图像被拉到哪里

标签 php css

我是 css 和编码的新手,但我想知道在下面的代码中它从帖子中提取图像的位置。我不希望此页面拉取图像...它从博客文章和页面中拉取图像...是否有我可以放置的代码以确保它不会拉取图像?

谢谢

<style>
    #para1{ text-align:center;}

    .bdr_blb{ 
        border:#000000 solid 4px;
        height:70px;
        background:#cccccc;
        text-align:center;
        font-size:14px; font-weight:700;}

    .light32{ font-size:32px;}

    .bggrey{ background:#cccccc;}

    .light18{ font-size:18px;}

    #bedroom4{
        background:#cccccc;
    }

    .heading_div{float:left;}

    .entry-content{float:left;}

    .thumnail_col ul li {
        float: left;
        list-style: none outside none;
        margin-right: 15px;
    }

    .thumnail_col ul li img{background:none; border:none;}

</style>

?>

    <div id="container">
        <div id="" role="main">
            <?php $args = array( 'category_name' => 'lease', 'orderby' => 'title' ,'order' => 'ASC' );
                        $loop = new WP_Query( $args );
                        while ( $loop->have_posts() ) : $loop->the_post();

                        if ($count==1)
                        {
                            echo "<tr>";
                        }
                        ?>
                       <td><div class="lease">
                            <div class="heading_div"><h2 class="entry-title"><strong><u>
                        <?php
                                                    echo '<a href="'.get_bloginfo('url').'/lease/'.$loop->post->post_name.'" target="_blank">'.$loop->post->post_title.'</a>';
                        ?>
                        </u></strong></div></h2>
                            <div class="entry-content">
                                <div class="desc">
                        <?php
                            the_content();
                        ?>
                        </div>

                        </div></div></td>
                        <?php
                        if($count==$number_of_columns)
                        {
                        echo "</tr>"; 
                        $count=0;
                        }   
                        $count++;

                        endwhile;
                    ?>

        </div><!-- #content -->
    </div><!-- #container -->

最佳答案

你需要找到函数the_content();在哪里被定义为。在某处寻找:

function the_content()

该函数定义的内部是可能 回显<img> 的代码标签。删除或注释掉那部分代码。不过,在我们看到该函数的定义之前,我们无法确定修改它的其他后果。

更新

这不会阻止图像被浏览器加载,但阻止它被浏览器实际显示。这比跟踪函数定义来修改 PHP 更容易。

<style>里面在上面发布的代码顶部添加标签,添加这个(它可以放在任何地方):

.entry-content img {display: none;}

这只是告诉 CSS 不显示图像,即使浏览器已经下载了它也是如此。

关于php - 想知道图像被拉到哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6688622/

相关文章:

php - 使用 PHP/jQuery 的 GET 传递数组

php - jquery AJAX 发送和接收数据请求中的未定义索引

html - 如何在两个面板页面上设置阴影,无论其高度如何?

php - Laravel CSS 文件链接修正

css - 我可以合并 :nth-child() or :nth-of-type() with an arbitrary selector? 吗

php - 为什么同一页面上会显示多个个人资料?

php - Allowed memory size of x exhausted error 使用 Yii 安装 PHPUnit

php - 在 Woocommerce 中将 COD 默认订单状态更改为 "On Hold"而不是 "Processing"

html - 在 Internet Explorer 11 中使用 <picture> 标签

jquery - 如何居中 Bootstrap 模式