/**
* query coupons on homepage in main wp query, fixes pagination
*
*/
function clpr_query_coupons_on_homepage( $query ) {
if( $query->is_main_query() && $query->is_home() )
$query->set( 'post_type', APP_POST_TYPE );
}
if ( version_compare($wp_version, '3.4', '>=') )
add_action( 'pre_get_posts', 'clpr_query_coupons_on_homepage' );
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.pages a').live('click', function(e){
e.preventDefault();
var block = jQuery(this).parents('.block').attr('id');
var href = jQuery(this).attr('href');
jQuery('#' + block).animate({
'opacity': '0.3'
}, 300, 'linear');
jQuery('#' + block).load(href + ' #' + block + '_cont', function(){
jQuery(this).animate({
'opacity': '1'
}, 300, 'linear');
});
});
});
</script>
<div id="block1">
<div id="block1"><div id="block1_cont">
<div id="block2">
<div id="block2"><div id="block2_cont">
<div id="block3">
<div id="block3"><div id="block3_cont">
<?php
if( $total_pages > 1 ){ ?>
<div><a href="<?php echo $post_type_url; ?>page/2/"> <?php _e( 'View More Ads', 'appthemes' ); ?> </a></div>
<?php } ?>
<?php
if( $total_pages > 1 ){ ?>
<div><?php if(function_exists('appthemes_pagination')) appthemes_pagination(); ?></div>
<?php } ?>
<?php get_template_part( 'loop', 'featured' ); ?>
<?php global $cp_has_next_page; ?>
<?php if($cp_has_next_page){ ?>
<div><a href="<?php echo $post_type_url; ?>page/2/?sort=popular"> <?php _e( 'View More Ads', 'appthemes' ); ?> </a></div>
<?php } ?>
<?php
if( $total_pages > 1 ){ ?>
<div><?php if(function_exists('appthemes_pagination')) appthemes_pagination(); ?></div>
<?php } ?>
<?php get_template_part( 'loop', 'ad_listing' ); ?>
<?php
if( $total_pages > 1 ){ ?>
<div><a href="<?php echo $post_type_url; ?>page/2/?sort=random"> <?php _e( 'View More Ads', 'appthemes' ); ?> </a></div>
<?php } ?>
<?php
if( $total_pages > 1 ){ ?>
<div><?php if(function_exists('appthemes_pagination')) appthemes_pagination(); ?></div>
<?php } ?>
danmont (February 3rd, 2013)
There are currently 1 users browsing this thread. (0 members and 1 guests)