WordPress.org

Ready to get started?Download WordPress

Forums

Videos not shown on custom template (1 post)

  1. wind_kind
    Member
    Posted 1 year ago #

    I created a new post type called videos. I created a page called Videos and it uses a custom template specifically for it. This template should show all the posts of the type video and nothing else.

    When creating a new video post I just copy the youtube share url in the post and it works as normal.

    When I view any of the video posts the video plays as normal. But when I view the videos page it only shows me all the video titles but none of the videos. When I view the source it doesn't even load the url or anything.

    Can anybody help me with this please?

    This is the custom template and the url to the site is http://toyotablog.teamgeek.co.za/videos/

    <?php
    /*
    Template Name: Video Template
    */
    ?>
    
    <?php get_header(); ?>
    
    	<div id="content">
    		<div id="inner-content" class="wrap clearfix">
    			<div id="main" class="eightcol first clearfix" role="main">
                    <?php $args = array(
                        'posts_per_page'  => 20,
                        'numberposts'     => 5,
                        'offset'          => 0,
                        'category'        => '',
                        'orderby'         => 'post_date',
                        'order'           => 'DESC',
                        'include'         => '',
                        'exclude'         => '',
                        'meta_key'        => '',
                        'meta_value'      => '',
                        'post_type'       => 'video_type',
                        'post_mime_type'  => '',
                        'post_parent'     => '',
                        'post_status'     => 'publish',
                        'suppress_filters' => false);
                    ?>
                    <?php $posts_array = get_posts( $args ); ?>
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
    					<section class="entry-content clearfix" itemprop="articleBody">
    
    						<div class="wrap clearfix">						
    
    								<div class="twelve first">
    
                                        <h1 class="page-title" itemprop="headline"><?php the_title(); ?></h1>
    
    									<p class="byline vcard"><?php
    										printf(__('Posted on <time class="updated" datetime="%1$s" pubdate>%2$s</time> by <span class="author">%3$s</span>.', 'bonestheme'), get_the_time('Y-m-j'), get_the_time(__('m/d/y', 'bonestheme')), bones_get_the_author_posts_link()); ?>
    									</p>
    
    									<?php the_content(); ?>
    
    								</div>
    
    							<?php endwhile; ?>
    							<?php wp_reset_query(); ?>
    						</div>
    
    					</section> <!-- end article section -->
    					<footer class="article-footer">
    						<p class="clearfix"><?php the_tags('<span class="tags">' . __('Tags:', 'bonestheme') . '</span> ', ', ', ''); ?></p>
    					</footer> <!-- end article footer -->
    				</article> <!-- end article -->
    
    				<?php endwhile; else : ?>
    
    						<article id="post-not-found" class="hentry clearfix">
    								<header class="article-header">
    									<h1><?php _e("Oops, Post Not Found!", "bonestheme"); ?></h1>
    							</header>
    								<section class="entry-content">
    									<p><?php _e("Uh Oh. Something is missing. Try double checking things.", "bonestheme"); ?></p>
    							</section>
    							<footer class="article-footer">
    									<p><?php _e("This is the error message in the page-custom.php template.", "bonestheme"); ?></p>
    							</footer>
    						</article>
    				<?php endif; ?>
    			</div> <!-- end #main -->
    
    			<?php get_sidebar(); ?>
    
    		</div> <!-- end #inner-content -->
    	</div> <!-- end #content -->
    
    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic