Public feed #601369

Unbenannt

public text v1 · immutable
Raw Edit
·published 2007-07-03 13:48 UTC
rendered paste body
<?php
						$results = $wpdb->get_results("SELECT ID, post_title, post_content, $wpdb->post2cat.category_id FROM $wpdb->posts LEFT JOIN $wpdb->post2cat ON $wpdb->post2cat.post_id = $wpdb->posts.ID WHERE post_type = 'page' AND post_status = 'publish' AND post_parent IN (11,12) ORDER BY post_date DESC LIMIT 4 OFFSET 2", ARRAY_A);
							if (!empty($results)) {
								foreach ($results as $result) {
						
									$postID = $result['ID'];
									$title = htmlspecialchars($result['post_title']);
									$permalink = get_permalink($postID);
									
									if (get_post_meta($postID, 'excerpt', true)) {
										$excerpt = get_post_meta($postID, 'excerpt', true);
										$excerpt = nl2br($excerpt);
									} else if (stristr($result['post_content'], '<!--more-->')) {
										$excerpt = substr($result['post_content'], 0, strpos($result['post_content'], '<!--more-->'));
										$excerpt = nl2br($excerpt);
									
									} else {
										$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="release-item category-<?php echo $result['category_id']; ?>">
									
										<?php do_action('the_teaser_image', 'wp-content/themes/sushitech_v1/objects/tsr-blank.png', $postID); ?>
                                        <div class="clr"></div>									
                                        <?php echo $title; ?> . <?php echo "<a href=\"$permalink\" title=\"$post->post_title\">$excerpt</a>" ?>
									        
									</div>
																			
									<?php
									/**
									 End of the mini-loop.  Don't edit past this point
									 */
									}
							}
					?>