How to put array on html post or page
-
How to put array on html post or page? this is the code the array is in from the theme page editor script.
<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>I would like to have the array active on a page rather than as in template below page. So wondering how to put it in the html text to trigger it to work inside the body of a page or post.
Reason, #1. hope to improve the over all functionality of landing page of site, hopefully improve some SEO for over all word and image count (if this will function as such).
As it is now the array is below the page content area.
site is NSFW http://lollipopx.com/ NSFW
Is it possible
The topic ‘How to put array on html post or page’ is closed to new replies.