[英]Is there access a php script on a wordpress theme
i have tried to load a flat panel write on PHP i put in a wordpress theme.我试图加载一个平板写在 PHP 上,我放入了一个 wordpress 主题。 for alone the script run great but i want run that on wordpress theme.
仅凭脚本运行得很好,但我想在 wordpress 主题上运行它。
problem in them routing.他们的路由问题。 for example: site/wp-content/themes/admin/dashboard/ site/wp-content/themes/admin/dashboard/sprofile site/wp-content/themes/admin/dashboard/rprofile
例如:site/wp-content/themes/admin/dashboard/site/wp-content/themes/admin/dashboard/sprofile site/wp-content/themes/admin/dashboard/rprofile
can not access above route.无法访问以上路线。
i think this solve with .htaccess file but don't know how !?我认为这可以用 .htaccess 文件解决,但不知道如何解决!? is there any way?!
有什么办法吗?!
If you're using wordpress you may want to create a shortcode for your script but, in case you don't want to, you can also use .htaccess with the rewrite module to redirect a url and access your panel.如果您使用的是 wordpress,您可能想为您的脚本创建一个短代码,但如果您不想,您也可以使用 .htaccess 和 rewrite 模块来重定向 url 并访问您的面板。
Here are two examples that I hope will help you:举两个例子,希望对你有帮助:
If I understood your situation correctly, you want to run a piece of PHP code which prints stuff inside the page as a feature in your WP theme.如果我正确理解您的情况,您希望运行一段 PHP 代码,该代码将页面内的内容打印为 WP 主题中的一项功能。 Not knowing the details, i can give you a couple of ideas:
不知道细节,我可以给你几个想法:
that is i want这就是我想要的
when enter to site/wp-content/themes/admin/dashboard/login当进入站点/wp-content/themes/admin/dashboard/login
rewrite to改写为
site/wp-content/themes/admin/dashboard/?url=login网站/wp-content/themes/admin/dashboard/?url=login
login not static
登录不是静态的
now i use this to htaccess but don't work :现在我用它来 htaccess 但不起作用:
RewriteRule ^wp-content/themes/bluetheme/dashboard/(.*)$ /subdirectory/wp-content/themes/bluetheme/dashboard?url=$1 [L,NC,QSA]
Don't try cheating on WP, by smuggling your php file in some dir and trying to call it from there, by tweaking .htaccess file and similar.不要试图欺骗 WP,通过在某个目录中走私您的 php 文件并尝试从那里调用它,通过调整 .htaccess 文件和类似文件。 Look for system way to create custom WP page.
寻找系统方式来创建自定义 WP 页面。 Ie
IE
https://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/ https://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.