![]() |
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. |
Maybe this plugin is what you need:
https://wordpress.org/plugins/insert-html-snippet/ Second result on Google "WordPress insert html in pages". |
so far no luck.
tried a bunch of plugins and short codes but no good. |
are you trying to use this code in a wordpress page?
|
Yes its word press
|
Might try SiteOrigin Page Builder.
|
All times are GMT -7. The time now is 06:13 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123