Showing Single Post In Wordpress

2 replies
  • WEB DESIGN
  • |
I have a Wordpress theme called "NewsTube" from "Theme-Junkie" (http:\\theme-junkie.com) that shows post excerpts in different sections on the home page.

I have installed this theme as a "Multisite" or "Networked" installation, and each new "blog" or "site" will be a replica of a "default" blog or site.

I would like the excerpt of a particular past to appear on the home page of each blog or site in place of the most recent, as defined by the theme.

Here is the relevant code from the theme index.php
Code:
<!--BEGIN OF FEATURED NEWS-->
<?php if (get_theme_mod('featured') == 'Yes') { ?>
<div id="featured">
<div class="boxleft" style="margin:0px;">

 <?php $recent = new WP_Query("cat=".get_theme_mod('featuredcat')."&showposts=1"); while($recent->have_posts()) : $recent->the_post(); ?>

<div class="featuredthumb"><?php tj_thumbnail(featuredthumbw, featuredthumbh); ?>
 <div class="featuredpost"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></div>

 </div>
<?php endwhile; ?>
</div> <!--end: boxleft-->
<div class="boxright" style="margin:0px;">
<?php $recent = new WP_Query("cat=".get_theme_mod('featuredcat')."&offset=1&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
<h1><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<span class="date"><?php the_time('M. j'); ?></span><span class="gray"> | </span><?php tj_content_limit('85'); ?>
<?php endwhile; ?>
<?php $recent = new WP_Query("cat=".get_theme_mod('featuredcat')."&offset=2&showposts=".get_theme_mod('featuredlist')); while($recent->have_posts()) : $recent->the_post();?>
<h2><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<span class="date"><?php the_time('M. j'); ?></span><span class="gray"> | </span><?php tj_content_limit('85'); ?>
<?php endwhile; ?>
</div> <!--end: boxright-->
<div class="clear"></div>
</div> <!--end: featured-->
<?php } ?>
<!--END OF FEATURED NEWS-->
How can I modify that code to only show a particular post in the "boxleft" area?

Replacing
Code:
 <?php $recent = new WP_Query("cat=".get_theme_mod('featuredcat')."&showposts=1"); while($recent->have_posts()) : $recent->the_post(); ?>
with
Code:
<?php $recent = new WP_Query('name=my-post-name')."&showposts=1"); while($recent->have_posts()) : $recent->the_post(); ?>
didn't work.

Any suggestions?
#post #showing #single #wordpress

Trending Topics