• I have the theme set up and working well. I do however need to sort the posts on the index page by category. Currently I only have two categories, sold and available. I have sold posts mixed with available posts. I would like it to sort the available posts first then the sold posts. Is this possible? I’ve searched for an answer but I don’t know where this is controlled in this particular theme.

    https://www.ads-software.com/plugins/cbach-wp-gridster/

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

    (@queenzukie)

    I found the page that needs edited but I have no idea what to do. Here is the code:

    <?php
    /**
     * @package Gridster
     */
    ?>
    
    <div id="post-<?php the_ID(); ?>" <?php post_class("poste"); ?>> <a href="<?php the_permalink(); ?>">
    <?php if ( has_post_thumbnail() ) {
    the_post_thumbnail('post-thumb', array('class' => 'postimg'));
    } else { ?>
    <img src="<?php bloginfo('template_directory'); ?>/img/defaultthumb.png" class="postimg" alt="<?php the_title(); ?>" />
    <?php } ?>
    </a>
    <div class="portfoliooverlay"><a href="<?php the_permalink(); ?>"><span>+</span></a></div>
    <h2 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark">
    <?php the_title(); ?><br><?php the_field('price'); ?>
    </a></h2>
    <p class="postmeta">
    <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    <?php
    				/* translators: used between list items, there is a space after the comma */
    				$categories_list = get_the_category_list( __( ', ', 'gridster' ) );
    				if ( $categories_list && gridster_categorized_blog() ) :
    			?>
    <?php printf( __( '%1$s', 'gridster' ), $categories_list ); ?>
    <?php endif; // End if categories ?>
    <?php endif; // End if 'post' == get_post_type() ?>
    </p>
    </div>
    <!-- post -->

    All I need to do is get it to sort by categories alphabetically. I don’t want to change the layout or anything major just change the sort order by category since the posts are showing up in date posted order presently.

Viewing 1 replies (of 1 total)
  • The topic ‘Sort posts on index page by category’ is closed to new replies.