• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Author Pro: archive-books.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Author Pro: archive-books.php

This topic is: resolved

Tagged: archives, Author Pro

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 9 months ago by susanhayse.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 5, 2015 at 4:30 pm #167491
    susanhayse
    Member

    I'd like to change the order of the books displayed on the books archive page from date of post to book title (a-z). Any idea how I can accomplish this?

    Thanks

    http://www.bigearthpublishing.com/books/
    October 5, 2015 at 4:38 pm #167492
    Brad Dalton
    Participant

    Try pre_get_posts with the is_post_type_archive conditional tag


    Tutorials for StudioPress Themes.

    October 24, 2015 at 6:12 am #168895
    susanhayse
    Member

    Thanks braddalton. I'm not enough of a developer to figure that out. I assume that's a line of code I'd add to my archive-books file but I don't know exactly how I would do that.

    October 24, 2015 at 11:54 am #168904
    susanhayse
    Member

    I solved this by using this snippet of code in the functions.php for Author Pro. It was probably what you were getting at braddalton.

    //*Change sort order on books archive 
    add_action( 'pre_get_posts', 'my_change_sort_order'); 
        function my_change_sort_order($query){
            if(is_archive()):
               $query->set( 'order', 'ASC' );
               //Set the orderby
               $query->set( 'orderby', 'title' );
            endif;    
        };
  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Author Pro: archive-books.php’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble