• Resolved lord_enzo

    (@lord_enzo)


    I know there are several threads about this issue, but I followed instructions from many of them and nothing seems to fix it.

    I have a page template, that loads custom post type on a static front page in a site. I choose how many posts I want to show on the code, and I can change it properly. The thing is that I cannot even see the pagination links. It’s not that they display the same always, or that they redirect me to a 404, nothing even appears there.

    This is my code:

    <?php
    /*
    Template Name: zvideos
    */
    /**
     * @package zseventyfour
     */
    
    get_header(); ?>
    
    <?php
    		$temp = $zvideos;
    		$zvideos = null;
    		$zvideos = new WP_Query();
    		$zvideos ->query( 'showposts=2&post_type=zvideo'.'&paged='.$paged );
    		if( $zvideos->have_posts() ) {
    			while( $zvideos->have_posts() ) {
    				$zvideos->the_post();
    					$zvideo_date = get_post_meta($post->ID, 'zvideo_date', true);
    					$zvideo_client = get_post_meta($post->ID, 'zvideo_client', true);
    					$zvideo_location = get_post_meta($post->ID, 'zvideo_location', true);
    					$zvideo_vimeo = get_post_meta($post->ID, 'zvideo_vimeo', true);
    					$zvideo_screenshot01 = get_post_meta($post->ID, 'zvideo_screenshot01');
    					$zvideo_job01 = get_post_meta($post->ID, 'zvideo_job01', true);
    					$zvideo_job02 = get_post_meta($post->ID, 'zvideo_job02', true);
    					$zvideo_job03 = get_post_meta($post->ID, 'zvideo_job03', true);
    					$zvideo_name01 = get_post_meta($post->ID, 'zvideo_name01', true);
    					$zvideo_name02 = get_post_meta($post->ID, 'zvideo_name02', true);
    					$zvideo_name03 = get_post_meta($post->ID, 'zvideo_name03', true);
    				?>
    				<section id="content">
    					<div class="wrapper">
    						<article>
    							<div class="vimeo">
    								<h1><?php the_title(); ?></h1>
    								<ul class="details">
    									<li><?php echo $zvideo_date?></li>
    									<li><?php echo $zvideo_client?></li>
    									<li><?php echo $zvideo_location?></li>
    								</ul>
    								<div class="vimeo-wrapper">
    									<iframe src="//player.vimeo.com/video/<?php echo $zvideo_vimeo?>" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
    								</div>
    							</div>
    							<div class="footage">
    								<ul class="images">
    									<li><img src="<?php echo $zvideo_screenshot01[0]?>" alt="<?php the_title(); ?>_01"/></li>
    									<li><img src="<?php echo $zvideo_screenshot01[1]?>" alt="<?php the_title(); ?>_02"/></li>
    									<li><img src="<?php echo $zvideo_screenshot01[2]?>" alt="<?php the_title(); ?>_03"/></li>
    									<li><img src="<?php echo $zvideo_screenshot01[3]?>" alt="<?php the_title(); ?>_04"/></li>
    									<li><img src="<?php echo $zvideo_screenshot01[4]?>" alt="<?php the_title(); ?>_05"/></li>
    									<li><img src="<?php echo $zvideo_screenshot01[5]?>" alt="<?php the_title(); ?>_06"/></li>
    								</ul>
    							</div>
    							<div class="clearfix"></div>
    							<div class="info">
    								<ul class="credits">
    									<li><p class="title"><?php echo $zvideo_job01?></p><p class="name"><?php echo $zvideo_name01?></p></li>
    									<li><p class="title"><?php echo $zvideo_job02?></p><p class="name"><?php echo $zvideo_name02?></p></li>
    									<li><p class="title"><?php echo $zvideo_job03?></p><p class="name"><?php echo $zvideo_name03?></p></li>
    									<li><p class="title"><?php echo $zvideo_job?></p><p class="name"><?php echo $zvideo_name?></p></li>
    									<li><p class="title"><?php echo $zvideo_job?></p><p class="name"><?php echo $zvideo_name?></p></li>
    									<li><p class="title"><?php echo $zvideo_job?></p><p class="name"><?php echo $zvideo_name?></p></li>
    								</ul>
    							</div>
    						</article>
    					</div><!-- END O WRAPPER -->
    				</section>			
    
    				<?php
    
    			}
    		}
    		else {
    			echo '<div style="width=100%;text-align:center;font-size:180%;">Ooops! Something went <strong>terribly</strong> wrong...</br> Or there are no videos to show. Who knows, this is obscure stuff.</div>';
    		}
    	?>
    				<section>
    					<div class="navigation">
    					  <div class="alignleft"><?php previous_posts_link('« Previous') ?>anterior</div>
    					  <div class="alignright"><?php next_posts_link('More »') ?>siguiente</div>
    					</div>
    				</section>
    <?php get_footer(); ?>

    The website is this one:

    http://www.zseventyfour.com

    I would prefer it to work with WP code, instead of a plugin, but right now anything would suffice.

    Also, I would really like to understand why nothing seems to work here, what I am doing wrong…

    Thanks in advance

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Type Pagination’ is closed to new replies.