admin管理员组文章数量:1291109
I am writing a custom php script and want to load the theme so it will look like a regular page. I tried the following.
<?php
define( 'WP_USE_THEMES', true );
require( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
$str = '';
get_header();
$str .= '<div id="primary" class="content-area">';
$str .= '<main id="main" class="site-main" role="main">';
$str .= 'Hello world';
$str .= '</main>';
$str .= '</div>';
echo $str;
get_footer();
?>
It shows the header and footer. However the content appears without borders/margins. A regular page on the site has borders/margins. This one does not.
I could style this page by hand so it matches a regular page. However I am trying to avoid doing it, because I want it to change with the theme.
Any suggestions on how I can get this page styled like a regular page on the site?
Thanks.
本文标签: cssWordpress custom php script to match standard page layout
版权声明:本文标题:css - Wordpress custom php script to match standard page layout 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741509685a2382534.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论