|
Post by account_disabled on Jan 26, 2024 23:59:07 GMT -6
并复制粘贴indexphp中的所有内容,直到并包括上面的代码。确保将其从索引文件中删除,以便它仅存在于头文件中。然后在索引文件的最顶部键入以下 PHP 代码: <?php get_header() ?> 复制 是时候对页脚做同样的事情了。在我们的头文件中,我们打开一个具有right-side 如果管理主题有详细记录,我们可以通过搜索此类找到它的结束元素。如果执行此搜索,您应该找到结束标记。 复制此结束标记之后(包括该结束标记)的所有内容,并将其粘贴到名为footerphp的新文件中。确保删除从索引文件复制的代码,并在文件的最后粘贴以下代码: <?php get_header() ?> 复制 替换本地资源引用 如果您现在加载主题,它会显示很多内容,但没有应。 用样式或 JavaScript。这是因为我们所有的引用都指向css/bootstrapmincss之类的东西。我们需要确保它们指向s:我们现在可以开始使用 WordPress 功能 购买电话号码列表 来让这一切变得更好。 使用文本编辑器将 的所有实例替换href=”为。这将确保对样式表的所有引用都有效。现在将 的所有实例替换src=”为src="<?php echo get_template_directory_uri() ?>/。您应该在headerphp和indexphp中执行此操作,但不要在 footerphp 中执行此操作。 在此阶段,您应该能够加载1921685555的网站并看到正确的布局。一些依赖。 JavaScript 的盒子目前还无法工作,但我们稍后会修复这个问题。 页脚文件有两个从 CDN 加载的 JavaScript 脚本,因此不应替换它们。第一个是 jQuery,它是加载的第一个脚本。第二个是名为拉斐尔的剧本。src=”将页脚文件中的所有实例替换为src="<?php echo get_template_directory_uri() ?>/,除了这两个资源。 最后要做的一件事:添加页眉和页脚挂钩。WordPress 使用它们来加载脚本和样式(除其他外)——它们是每个主题的必要组件。添加在头文件中的<?php wp_head() ?>结束标记之前以及页脚中的结束标记之前。<head><?php wp_footer() ?><body> 如果您正确完成了所有操作,您现在应该会看到所有完整的方框,其中有大量的图表和地图。恭喜,您刚刚设置好。
|
|