PHP 未在 .INC 文件中执行
不太确定“php”是否与此有关。请查看http://iamwhitebox.com/staging/arkitek/#press
我有一个默认值我页面上的选项卡显示 2 篇按日期排序的博客文章。 但当我在菜单中单击返回时它不会显示,我已将其包含在内 在两个不同的地方,有没有更简单的方法来实现这一点?我知道有
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('/home/whiteb0x/iamwhitebox.com/staging/arkitek/blog/wp-blog-header.php');
query_posts('cat=3&showposts=2');
?>
<article class="blog-feed">
<?php while (have_posts()): the_post(); ?>
<!-- begin post -->
<div class="blog-title">
<div class="blog-date">
<?php the_time('m.j.Y'); ?>
</div>
<strong><a class="blog-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>">
<?php the_title(); ?>
</a></strong>
</div>
<a class="blog-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>">
<div class="blog-thumbnail"><?php the_post_thumbnail( array(80,80) ); ?></div><?php the_content(); ?>
</a>
<div class="clearfix"></div>
<?php endwhile; ?>
</article>
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('/home/whiteb0x/iamwhitebox.com/staging/arkitek/blog/wp-blog-header.php');
query_posts('cat=3&showposts=2');
?>
<!DOCTYPE html>
<html>
<head></head>
<body>
<ul>
<li id="current_news">
<?php
echo "HELLO";
?>
**<?php
require('post.inc')
?>**
Not quite sure if 'php' has anything to do with it. please review http://iamwhitebox.com/staging/arkitek/#press
I have a default tab on my page that displays 2 blog posts sorted by date.
but it wont show up when I click back to it in the menu, I have it included
in two separate places, is there an easier way to achieve this?? I know there is
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('/home/whiteb0x/iamwhitebox.com/staging/arkitek/blog/wp-blog-header.php');
query_posts('cat=3&showposts=2');
?>
<article class="blog-feed">
<?php while (have_posts()): the_post(); ?>
<!-- begin post -->
<div class="blog-title">
<div class="blog-date">
<?php the_time('m.j.Y'); ?>
</div>
<strong><a class="blog-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>">
<?php the_title(); ?>
</a></strong>
</div>
<a class="blog-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>">
<div class="blog-thumbnail"><?php the_post_thumbnail( array(80,80) ); ?></div><?php the_content(); ?>
</a>
<div class="clearfix"></div>
<?php endwhile; ?>
</article>
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('/home/whiteb0x/iamwhitebox.com/staging/arkitek/blog/wp-blog-header.php');
query_posts('cat=3&showposts=2');
?>
<!DOCTYPE html>
<html>
<head></head>
<body>
<ul>
<li id="current_news">
<?php
echo "HELLO";
?>
**<?php
require('post.inc')
?>**
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
post.inc
是否以开头?
如果您希望代码在包含时执行,那么包含文件必须具有该内容,这一点很重要。
Does
post.inc
start with a<?php
?It's important that your include file have that if you want your code to execute when you include.