• Resolved NigelFreeney

    (@nigelfreeney)


    I am new to php and WordPress. I am fairly experienced with VB Script and Classic ASP 3.0.

    I have transformed an existing site from ASP to WordPress CMS and all has gone pretty much as planned apart from needding to create a list which is sorted first by a custom field Client_Type and then by date.

    THe category page contains one of these for each different value in the Client_Type custom field. Clicking through to the single.php page I want the backward and forward navigation to run through the pages in groups from wherever the entry point is i.e. if I had 8 dates in 3 groups:
    Group1, date3,date5,date6 <=> Group2 Date1,date2 <=> Group3, date4,date7,date8

    The code for the query is here:

    <h2 class="restaurantandpubs"><span>Restaurants & Pubs</span></h2>
        <?php query_posts('cat=3&meta_key=Client_Type&meta_value=Restaurants&showposts=-1&orderby=Client-Type&order=DESC'); ?>
    		<?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>
            <h3 class="casetitles"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
            <?php endwhile; ?>
            <?php endif; ?>

    I would be very grateful if someone could help me with this so I can finish the site off.

    Thanks in advance,

    Nigel

Viewing 1 replies (of 1 total)
  • Thread Starter NigelFreeney

    (@nigelfreeney)

    I realised on review that the best solution to this problem was to setup sub categories.

    I then hard coded a new page which was the template for the parent category and created 4 separate searches (one for each category. Each grioup linked to it’s own single page and then used the next prev navigation with a back to main lists link to complete the options.

Viewing 1 replies (of 1 total)
  • The topic ‘How to sort on a custom field then subsort by date?’ is closed to new replies.