Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By chriswareham

Thread: Move the category list to show under the home tabs

  1. #1
    Thread Starter
    Veteran chriswareham's Avatar
    Join Date
    Apr 2012
    Location
    Staffordshire, UK
    Posts
    296
    Thanks
    18
    Thanked 40 Times in 38 Posts

    Move the category list to show under the home tabs

    Hi folks, i have had a few messages asking how to move the categories directory from the homepage and display them in a new tab on the homepage next to "Just listed, Popular etc "

    1) tpl-ads-home.php

    find the following code under the left block comment and comment it out like so:

    <!-- left block -->
    <?php /*<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 } ?>

    */ ?>
    2) just below is the tab control, you will need to add a new <li> tag with a link to #block4 like so:

    <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>
    <li><a href="#block4"><span class="big"><?php _e( 'Categories', APP_TD ); ?></span></a></li>
    </ul>

    3) underneath tab 3

    <!-- 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 -->

    we will need to start a new tab 4 and add the contents that we commented out earlier like so:

    <!-- tab 3 -->

    <div = id="block4">

    <div class="clr"></div>
    <?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><!-- /block4 -->

    should end up with a result like this

    cats.jpg
    sonnycool likes this.

  2. The Following 2 Users Say Thank You to chriswareham For This Useful Post:

    sonnycool (July 29th, 2014), white (January 4th, 2015)

  3. #2
    Thread Starter
    Veteran chriswareham's Avatar
    Join Date
    Apr 2012
    Location
    Staffordshire, UK
    Posts
    296
    Thanks
    18
    Thanked 40 Times in 38 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. The Following User Says Thank You to chriswareham For This Useful Post:

    denik75 (July 30th, 2014)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to show ads in the Tabs(blocks) from a specific category only?
    By nonamege in forum ClassiPress General Discussion
    Replies: 1
    Last Post: January 12th, 2015, 02:40 AM
  2. Show part of the listings on home page list
    By demonoid in forum Vantage General Discussion (Legacy)
    Replies: 10
    Last Post: October 13th, 2013, 12:48 AM
  3. [MOD NEEDED] Prevent a category from listing in home page tabs
    By joniboy in forum ClassiPress General Discussion
    Replies: 14
    Last Post: August 21st, 2012, 12:30 PM
  4. move categories to tabs and popular ads into tabs.
    By spymare in forum ClassiPress General Discussion
    Replies: 16
    Last Post: September 9th, 2011, 04:32 PM
  5. move categories to tabs and popular ads into tabs.
    By spymare in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: August 14th, 2011, 08:32 AM