我有一个index.php
带有about链接的页面,可以从WordPress仪表板中创建的名为about的页面(帖子)获取作者内容。我正在使用Magnific Popup poups插件。我有about.php
其中包括以下关于页面的内容:
<?php
$pageid = 2; // 2 is the id of about page/post
$about = get_post($pageid);
?>
<div id="custom-content" class="white-popup-block" style="max-width:600px; margin: 20px auto;">
<h3><?php echo $about->post_title; ?></h3>
<style>
#custom-content img {max-width: 100%;margin-bottom: 10px;}
</style>
<div class="image-container pull-left">
<img src="<?php echo get_field( "image", $pageid ); ?>">
</div>
<h4><?php echo get_field( "brief", $pageid ); ?></h4>
<p>
<?php echo get_field( "brief_lines", $pageid ); ?>
</p>
<div class="about-content">
<?php echo $about->post_content; ?>
</div>
</div>
并且在index.php
<a href="<?php echo get_template_directory_uri(); ?>/about.php" class="morelink pull-left text-ajax-popup">read more</a>
在footer.php
$(\'.text-ajax-popup\').magnificPopup({
type: \'ajax\',
alignTop: true,
overflowY: \'scroll\'
});
单击链接后,我出现以下错误:致命错误:调用未定义的函数get\\u post()
里面有文件吗about.php
? 问题是什么?