I just want to ask how can I add pagination here in this code:
<?php if ( get_option('webly_display_media') == 'on' ){ ?>
<div id="recent-projects">
<div id="recent-projects-right">
<div id="recent-projects-content" class="clearfix">
<?php
$args=array(
'showposts' => '7',
'category__not_in' => get_option('webly_exlcats_media')
);
query_posts($args);
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$width = 140;
$height = 72;
$titletext = get_the_title();
$thumbnail = get_thumbnail($width,$height,'project-image',$titletext,$titletext,true,'Media');
$thumb = $thumbnail["thumb"];
$et_medialink = get_post_meta($post->ID,'et_medialink',true) ? get_post_meta($post->ID,'et_medialink',true) : '';
$et_videolink = get_post_meta($post->ID,'et_videolink',true) ? get_post_meta($post->ID,'et_videolink',true) : '';
?>
<div class="project">
<?php if ( $et_medialink <> '' ) { ?>
<a href="<?php echo $et_medialink; ?>">
<?php } elseif ( $et_videolink <> '' ) { ?>
<a href="<?php echo $et_videolink; ?>" rel="prettyPhoto[media]" class="et-video" title="<?php echo $titletext; ?>">
<?php } else { ?>
<a href="<?php echo $thumbnail["fullpath"]; ?>" rel="prettyPhoto[media]" title="<?php echo $titletext; ?>">
<?php } ?>
<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, 'project-image'); ?>
<span class="zoom-icon"></span>
<span class="project-overlay"></span>
</a>
</div> <!-- end .project -->
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
</div> <!-- end #recent-projects-content -->
</div> <!-- end #recent-projects-right -->
</div> <!-- end #recent-projects -->
My posts has a featured video and currently that code displays 5 featured video base on the category. The problem is, I already have 11 posts in that category but the theme can only display 5 posts so I want to have a pagination for that. Can you help me? Here’s the development site http://dev.freelanceu.net/mjl/fitnessadventure/. You can see the above code at the bottom of the content, before the footer.
Add this to functions.php:
Then grab your paginated links using this: