All pastes #67574 Raw Edit

Mine

public text v1 · immutable
#67574 ·published 2006-06-20 08:17 UTC
rendered paste body
<?php
					$results = $wpdb->get_results("SELECT ID, post_title, post_content FROM $wpdb->posts WHERE post_status = 'static' AND post_parent = 3 ORDER BY post_date DESC LIMIT 2", ARRAY_A);
					if (!empty($results)) {
						foreach ($results as $result) {
				
							$postID = $result['ID'];
							$title = htmlspecialchars($result['post_title']);
							$permalink = get_permalink($postID);
							$excerpt = $result['post_content'];
							/**$excerpt = strip_tags($excerpt);*/
							$excerpt_length = 55;
							$words = explode(' ', $excerpt, $excerpt_length + 1);
							if (count($words) > $excerpt_length) {
								array_pop($words);
								array_push($words, '[...]');
								$excerpt = implode(' ', $words);
							}
							$excerpt = nl2br($excerpt);
							
							/**
							 This starts the "mini-loop".  Edit the HTML inside here to display the pages
							 the way you want.
							 */
							?>
								<div class="body-releases-list">
								<p><?php do_action('the_teaser_image', 'http://www.sudelectronic.com/wp/wp-content/themes/sued/images/img-rec.jpg', $postID); ?>
										<a href="<?php echo $permalink; ?>" title="<?php echo $title; ?>"><?php echo $title; ?></a><br />
										<?php echo $excerpt; ?></p>
								</div>
								
							<?php
							/**
							 End of the mini-loop.  Don't edit past this point
							 */
						}
					}
				?>