我有一个想要更改的文本(下面代码中的“Happy Clients”)。我尝试在 WP 仪表板和模板编辑器中查找文本,但没有成功,如何找到该类以便能够更改文本?
<div class="_slider_shadow"></div>
</div><!-- /.carousel -->
<div class="count"><div class="count-info"><strong id="targetElem">0</strong><span class="count-description"> Happy Clients</span></div></div>
<script type="text/javascript">
编辑 我找到一个文件,其中包含与我要更改的文本相关的以下代码:
<div class="count"><div class="count-info"><strong id="targetElem">0</strong><span class="count-description"><?php the_field('text_for_count'); ?></span></div></div>
<script type="text/javascript">
var endVal = <?php the_field('count'); ?>;
var numAnim = new CountUp("targetElem", 0, endVal - 300, 0 , );
numAnim.start(function() {
numAnim.update(endVal);
});
</script>
最佳答案
您可以安装Query Monitor
插入。它有一个名为 Template
的部分,其中显示了用于加载页面的所有模板文件。这应该可以帮助您找到您需要的东西。
Example output
关于javascript - 如何在WP中找到特定的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50326952/