【问题标题】:Wordpress always load same page - index.phpWordpress 总是加载相同的页面 - index.php
【发布时间】:2019-08-16 21:25:56
【问题描述】:

我有一个带有自定义主题的 Wordpress 网站。在 index.php 上一切正常,但是当我再创建一个页面(index2.php 或 adminpage.php)并尝试在浏览器中加载该页面时,WordPress 会将我重定向到 index.php

好的,这是文件设置:https://ibb.co/9n7Qdxt。这是普通 index.php 的 URL:https://ibb.co/M69f5bD。这是一个问题:https://ibb.co/kJFW4ZZ ps: adminpage.php 为空但浏览器加载 index.php 图片:https://ibb.co/x2T82dc

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
    <link rel="icon" href="favicon.ico">
    <link rel="icon" href="favicon.png">
    <title></title>

    <?php wp_head(); ?>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Libre+Franklin:100,100i,200,200i,300,300i,400,400i,500,500i" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">

</head>

问题:无论用户输入哪个 url,Wordpress 总是将用户重定向到 index.php ...

【问题讨论】:

    标签: php wordpress


    【解决方案1】:

    根据您的描述,您没有将 adminpage.php 添加为模板文件并将其分配给后端的页面。这是一个链接,可帮助您在 WordPress 中进行模板主题化。

    https://developer.wordpress.org/themes/basics/template-hierarchy/

    【讨论】:

    • 谢谢,我不明白的模板层次结构。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-10
    • 1970-01-01
    • 2013-07-11
    • 1970-01-01
    • 1970-01-01
    • 2020-06-08
    • 1970-01-01
    相关资源
    最近更新 更多