在wordpress主题中查找代码生成的位置?

时间:2017-10-25 11:09:45

标签: wordpress

我正在使用DIVI,我需要找到生成特定div(或两个)的位置,以便我可以添加另一个div来包含后面的元素。

我要跟进的div是.et_pb_image_container。在blog.php中有很多功能,但是当我添加测试类时,它们不会显示在DOM中。

我还尝试了3个不同的插件,声称指示生成了哪个页面代码,但是他们只说了page.php,它只包含页面的外部容器。

也许这段代码可能会暗示要查看的其他地方?

$this->custom_css_options = array(
        'title' => array(
            'label'    => esc_html__( 'Title', 'et_builder' ),
            'selector' => '.entry-title',
        ),
        'post_meta' => array(
            'label'    => esc_html__( 'Post Meta', 'et_builder' ),
            'selector' => '.post-meta',
        ),
        'pagenavi' => array(
            'label'    => esc_html__( 'Pagenavi', 'et_builder' ),
            'selector' => '.wp_pagenavi',
        ),
        'featured_image' => array(
            'label'    => esc_html__( 'Featured Image', 'et_builder' ),
            'selector' => '**.et_pb_image_container**',
        ),
        'read_more' => array(
            'label'    => esc_html__( 'Read More Button', 'et_builder' ),
            'selector' => '.more-link',

1 个答案:

答案 0 :(得分:0)

它是在第15017行附近的main-modules.php文件中生成的

elseif ( '' !== $thumb && 'on' === $show_thumbnail ) :
        if ( 'on' !== $fullwidth ) echo '<div class="et_pb_image_container">'; ?>
            <a href="<?php esc_url( the_permalink() ); ?>" class="entry-featured-image-url">
                <?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height ); ?>
                <?php if ( 'on' === $use_overlay ) {
                    echo $overlay_output;
                } ?>
            </a>
    <?php
        if ( 'on' !== $fullwidth ) echo '</div> <!-- .et_pb_image_container -->';
    endif;
} ?>