| Showing Specific Post Need to show a specific post in the home page content |
calvinmicklefinger

msg:4361430 | 3:29 pm on Sep 12, 2011 (gmt 0) | 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 <!--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 | <?php $recent = new WP_Query("cat=".get_theme_mod('featuredcat')."&showposts=1"); while($recent->have_posts()) : $recent->the_post(); ?> |
| with | <?php $recent = new WP_Query('name=my-post-name')."&showposts=1"); while($recent->have_posts()) : $recent->the_post(); ?> |
| didn't work. Any suggestions?
|
|