Results 1 to 2 of 2

Thread: How can i rearrange the homepage so my pagination is above categories ?

  1. #1
    Thread Starter
    st3v3's Avatar
    Join Date
    Jul 2014
    Location
    Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can i rearrange the homepage so my pagination is above categories ?

    Hi im new and have been trying to modify tpl-ads-home.php so I could have pagination above the categories listing on my homepage but I cant seem to figure it out. any help is greatly appreciated. Thank you .

    <?php
    // Template Name: Ads Home Template
    ?>


    <div class="content">

    <div class="content_botbg">

    <div class="content_res">

    <?php get_template_part( 'featured' ); ?>

    <!-- left block -->
    <div class="content_left">


    <?php if ( $cp_options->home_layout == 'directory' ) { ?>

    <div class="shadowblock_out">

    <div class="shadowblock">

    <h2 class="dotted"><?php _e( 'Ad Categories', APP_TD ); ?></h2>

    <div id="directory" class="directory <?php cp_display_style( 'dir_cols' ); ?>">

    <?php echo cp_create_categories_list( 'dir' ); ?>

    <div class="clr"></div>

    </div><!--/directory-->

    </div><!-- /shadowblock -->

    </div><!-- /shadowblock_out -->

    <?php } ?>


    <div class="tabcontrol">

    <ul class="tabnavig">
    <li><a href="#block1"><span class="big"><?php _e( 'Just Listed', APP_TD ); ?></span></a></li>
    <li><a href="#block2"><span class="big"><?php _e( 'Most Popular', APP_TD ); ?></span></a></li>
    <li><a href="#block3"><span class="big"><?php _e( 'Random', APP_TD ); ?></span></a></li>
    </ul>

    <?php
    remove_action( 'appthemes_after_endwhile', 'cp_do_pagination' );
    $post_type_url = add_query_arg( array( 'paged' => 2 ), get_post_type_archive_link( APP_POST_TYPE ) );
    ?>


    <!-- tab 1 -->
    <div id="block1">

    <div class="clr"></div>

    <div class="undertab"><span class="big"><?php _e( 'Classified Ads', APP_TD ); ?> / <strong><span class="colour"><?php _e( 'Just Listed', APP_TD ); ?></span></strong></span></div>

    <?php
    // show all ads but make sure the sticky featured ads don't show up first
    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    query_posts( array( 'post_type' => APP_POST_TYPE, 'ignore_sticky_posts' => 1, 'paged' => $paged ) );
    $total_pages = max( 1, absint( $wp_query->max_num_pages ) );
    ?>

    <?php get_template_part( 'loop', 'ad_listing' ); ?>

    <?php
    if ( $total_pages > 1 ) {
    ?>
    <div class="paging"><a href="<?php echo $post_type_url; ?>"> <?php _e( 'View More Ads', APP_TD ); ?> </a></div>
    <?php } ?>

    </div><!-- /block1 -->


    <!-- tab 2 -->
    <div id="block2">

    <div class="clr"></div>

    <div class="undertab"><span class="big"><?php _e( 'Classified Ads', APP_TD ); ?> / <strong><span class="colour"><?php _e( 'Most Popular', APP_TD ); ?></span></strong></span></div>

    <?php get_template_part( 'loop', 'popular' ); ?>

    <?php
    global $cp_has_next_page;
    if ( $cp_has_next_page ) {
    $popular_url = add_query_arg( array( 'sort' => 'popular' ), $post_type_url );
    ?>
    <div class="paging"><a href="<?php echo $popular_url; ?>"> <?php _e( 'View More Ads', APP_TD ); ?> </a></div>
    <?php } ?>

    <?php wp_reset_query(); ?>

    </div><!-- /block2 -->


    <!-- tab 3 -->
    <div id="block3">

    <div class="clr"></div>

    <div class="undertab"><span class="big"><?php _e( 'Classified Ads', APP_TD ); ?> / <strong><span class="colour"><?php _e( 'Random', APP_TD ); ?></span></strong></span></div>

    <?php
    // show all random ads but make sure the sticky featured ads don't show up first
    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    query_posts( array( 'post_type' => APP_POST_TYPE, 'ignore_sticky_posts' => 1, 'paged' => $paged, 'orderby' => 'rand' ) );
    $total_pages = max( 1, absint( $wp_query->max_num_pages ) );
    ?>

    <?php get_template_part( 'loop', 'ad_listing' ); ?>

    <?php
    if ( $total_pages > 1 ) {
    $random_url = add_query_arg( array( 'sort' => 'random' ), $post_type_url );
    ?>
    <div class="paging"><a href="<?php echo $random_url; ?>"> <?php _e( 'View More Ads', APP_TD ); ?> </a></div>
    <?php } ?>

    </div><!-- /block3 -->


    </div><!-- /tabcontrol -->

    </div><!-- /content_left -->


    <?php get_sidebar(); ?>


    <div class="clr"></div>

    </div><!-- /content_res -->

    </div><!-- /content_botbg -->

    </div><!-- /content -->

  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to rearrange the ads categories drop-down list?
    By remyboy21 in forum ClassiPress General Discussion
    Replies: 6
    Last Post: November 8th, 2013, 06:28 AM
  2. How to rearrange categories
    By vyadmin in forum Vantage General Discussion (Legacy)
    Replies: 1
    Last Post: July 16th, 2013, 06:31 AM
  3. How to rearrange categories
    By vyadmin in forum Help Using Vantage (Legacy)
    Replies: 1
    Last Post: July 16th, 2013, 06:31 AM
  4. [SOLVED] Homepage and pagination 404
    By apollog in forum Report Vantage Bugs (Legacy)
    Replies: 3
    Last Post: July 15th, 2012, 02:19 PM
  5. Rearrange Categories
    By austenburns in forum Help Using ClassiPress
    Replies: 5
    Last Post: July 26th, 2010, 08:56 PM