Word Press template to page script question
Is it possble and exactly how would it be to add this on page rather than through theme template so it functions on page as well?
heres script in question as much as far as I can tell is needed from the template
<h2 class="post-title">Videos selected for you</h2>
<?php $args = array( 'numberposts' => 42, 'orderby' => 'rand', 'category__in' => array(782, 829) ); $rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<div class="post" id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(240,180), array('alt' => get_the_title(), 'title' => '')); ?></a>
<?php if ( get_post_meta($post->ID, 'duration', true) ) : ?><div class="duration"><?php echo get_post_meta($post->ID, 'duration', true) ?></div><?php endif; ?>
<div class="link"><a href="<?php the_permalink() ?>"><?php short_title('...', '34'); ?></a></div>
</div>
<?php endforeach; ?>
<div class="clear"></div>
<?php }
else { ?>
<h2>Sorry, no posts matched your criteria</h2>
<?php } ?>
</div>
whats needed and not needed to make this work on page.
|