Wordpress .htaccess/模板文件 [英] Wordpress .htaccess/template files

查看:37
本文介绍了Wordpress .htaccess/模板文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Wordpress 网站,我假设它来自另一家公司,它的结构与我工作过的其他公司略有不同.我主要是一名 Drupal 开发人员,具有足够的 Wordpress 工作知识.

I have a Wordpress site that I assumed from another company which structurally is a bit different than other ones I've worked on. I'm primarily a Drupal developer, with enough of a working knowledge of Wordpress to get by.

创建站点的开发人员所做的是在主题文件夹中,他们为站点上的每个页面创建了一个单独的 page-whatever-whatever.php 文件.网站页面上的一些内容是通过 CMS 系统输入的 - 有些是硬编码到模板文件中的.

What the developer who created the site did, is within the themes folder, they created a separate page-whatever-whatever.php file for each page on the site. Some of the content on the pages within the site have been entered through the CMS system - some are hard coded on to the template file.

以前,它托管在 .NET 服务器上 - 我们使用 LAMP.

Previously, it was hosted on a .NET server - we're on LAMP.

似乎没有调用带有硬编码数据的页面 - 因此客户端之前看到的数据只是空白.该站点似乎忽略了那些 page-whatever-whatever.php 文件,而是使用默认模板页面.

It appears that the pages with the hard coded data aren't being called - so the data the client previously saw is just coming up blank. The site appears to be ignoring those page-whatever-whatever.php files and using the default template page instead.

我的第一个猜测是这是一个 htaccess 问题?我只有通用的

My first guess is that it's an htaccess issue? I just have the generic

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

考虑到它们的结构 - 我应该在那里放入其他东西或在配置文件中进行更改吗?

Given the structure they have - is there something else I should be putting in there or changing within the config files?

提前致谢!

推荐答案

我想 .htaccess 文件没有问题.错误在模板文件中.在 wp-config.php 中启用调试.

I guess no issue with .htaccess file. The error was in template file. Enable debug in wp-config.php.

wp_debug 是假的.

By wp_debug was false.

define('WP_DEBUG', false);

将此更改为

define('WP_DEBUG', true);

现在你可以在模板文件中看到php错误然后调试它.

Now you can see php error in the template file then debug it.

这篇关于Wordpress .htaccess/模板文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆