打开自定义php文件时保持WordPress主题和布局

打开自定义php文件时保持WordPress主题和布局,php,wordpress,Php,Wordpress,我正在尝试将一些定制的php文件合并到WordPress站点中。 在这些文件中创建了指向其他文件的链接 <? echo "<a href=show.php?x=" . $row['Name'] . ">" $row['Name'] . "</a><br> "; ?> 这可以与WordPress的php执行插件配合使用。唯一的问题是show.php打开时没有WordPress主题和布局 如何创建链接,使新的php文件在与WordPres

我正在尝试将一些定制的php文件合并到WordPress站点中。 在这些文件中创建了指向其他文件的链接

<?
    echo "<a href=show.php?x=" . $row['Name'] . ">" $row['Name'] . "</a><br> ";
?>

这可以与WordPress的php执行插件配合使用。唯一的问题是show.php打开时没有WordPress主题和布局

如何创建链接,使新的php文件在与WordPress页面布局相同的(侧)栏/框架中打开?

您需要为此创建自定义模板
you need to create a custom template for that

The syntax is something like this:

<?php
/*
Template Name: My Custom Page
*/
get_header();
?>

Here your HTML coding goes

<?php get_footer(); ?>

This will give you the look and feel you are looking for!!
语法如下所示: 这是您的HTML编码 这将给你的外观和感觉,你正在寻找!!
找到了我自己的工作

在WordPress中创建一个页面(page_id=x)并包含一个exec php插件。 在页面上包含此代码

<? 
$page_include =$_GET["page_include"];
include $page_include; 
?>

如果要在wordpress中显示自定义页面,请创建以下链接:

<? 
echo "<a href=?page_id=x&page_include=" . $page_link . "> link </a>"
?>


是否可以自动从wordpress继承/css?是的,它将自动继承header.php文件中包含的所有css文件