我使用此代码在外部网站上显示wordpress帖子:
原文链接:https://www.f2er.com/php/136397.html<?PHP require('wp_blog/wp-blog-header.PHP'); if($_GET["p"] > '') { ?> <?PHP query_posts('p='.$_GET["p"].''); ?> <?PHP while (have_posts()) : the_post(); ?> <h4><?PHP the_title(); ?></h4> <?PHP the_content(); ?> <?PHP endwhile; ?> <?PHP } else { ?> <?PHP $posts = get_posts('numberposts=10&order=ASC&orderby=post_title'); foreach ($posts as $post) : setup_postdata( $post ); ?> <?PHP the_date(); echo "<br />"; ?> <?PHP the_title(); ?> <?PHP the_excerpt(); ?> <?PHP endforeach; ?> <?PHP } ?>
而不是根据ID选择帖子,我如何根据帖子标题选择帖子?