• I have managed to integrate a custom taxonomies plugin that:

    -Filters down the staff depending on what category is selected.

    I want it to show that department first, and then the other departments beneath rather than that department all on its own (how it is now).

    Here is the link: http://crippslawtest.co.uk/people/

    I am guessing I need to add a second part to my loop, that says “And display all posts from all other categories afterwards”.

    Here is my WordPress loop:

    <div class="staffwrapper">
        <?php
        $args = array( 'post_type' => 'cripps_staff', 'posts_per_page' => 300 );
        $loop = new WP_Query( $args );
        while ( $loop->have_posts() ) : $loop->the_post();
    
        echo '<div class="col-md-3 spacetop">';
        echo '<a href="'.get_permalink().'">';
        echo '<img src="';
        echo get_post_meta($post->ID,'image',true);
        echo '">';
        echo '</a>';
        echo '<h2 class="staffname">';
        echo get_post_meta($post->ID,'staff_name',true);
        echo '</h2>';
        echo '<h2 class="staffrole">';
        echo get_post_meta($post->ID,'staff_role',true);
        echo '</h2>';
        echo '<h2 class="staffnumber">';
        echo get_post_meta($post->ID,'staff_telephone_number',true);
        echo '</h2>';
        echo '<h2 class="staffemail">';
        echo get_post_meta($post->ID,'staff_email_address',true);
        echo '</h2>';
        echo '</div>';
        endwhile;
        ?>
        </div><!--End of staff wrapper-->

    I am thinking of writing an if/else statement “If there are less than 100 posts, add all the other posts in the loop”, Is that the right thing to do? How please? 🙂

    Thank you!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Custom Taxonomy Filtering with WordPress’ is closed to new replies.