WordPress的:上传到服务器时无法找到文件和网页
问题描述:
我最近上传了一个wordpress在我的服务器。在本地主机上,它正在工作,但当我上传时,有些页面无法找到。我想这是因为路径。WordPress的:上传到服务器时无法找到文件和网页
我所有的模板文件都位于主题文件夹内。一些模板文件正在调用一些可以在根目录中找到的php文件。例如,template-product.php中的打印按钮调用printProductProfile.php。
我正在使用下面的jquery代码,但它不工作。它说,页面无法找到。我怎样才能解决这个问题?
//jquery code in template-product.php
('#print').click(function(e){
var productID = document.getElementById('productID').value;
popupWindow = window.open(
'../printProductProfile.php?id='+productID,
'PDF Viewer',
'height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes');
});
下面显示的是我的文件夹和文件的结构。
public_html
-printProductProfile.php
-wp-content
-themes
-myTheme-child
-template-product.php
答
使用ABSPATH
像
ABSPATH.'/printProductProfile.php?id='+productID
或使用'printProductProfile.php?id='+productID
我想你的答案,但它仍然没有工作。 – user3383911
@ user3383911尝试仅使用'printProductProfile.php',并回显此'ABSPATH.'wp-content/themes/{your_theme} // printProductProfile.php'并粘贴输出。 – Arif