[Support request] Specific category posts archive only to be displayed in reverse order?

Home Forums Support [Support request] Specific category posts archive only to be displayed in reverse order?

Home Forums Support Specific category posts archive only to be displayed in reverse order?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1086756
    Chris

    Apologies first, I’m a designer (not a coder!) slowly transitioning my site over to GP Pro. Hope this is an OK question to ask as a newbie here!

    the new 2.0 version of the site will, for me, be a big change from my current Customizr theme version. It will be a combination of GP and Elementor. As part of the new look, one historical section will be a specific Category archive (‘Early Bay’)

    I saw this plugin https://wordpress.org/plugins/category-reverse-order/ which sounded ideal but had zero feedback, so I was reluctant to try it.

    (just tried it on a staging site and it didn’t seem to play nicely with my configuration…)

    This code snippet came up in my searches…
    —-
    function change_category_order( $query ) {
    if ( $query->is_category(‘Early Bay’) && $query->is_main_query() ) {
    $query->set( ‘order’, ‘ASC’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘change_category_order’ );
    —-

    My question is would this be the best way to go with GP, or should I look for a developer to help with some custom CSS?

    If it makes any differences, the archive is created with a custom loop with Ele Custom Skin?

    #1087101
    Leo
    Staff
    Customer Support

    Hi there,

    That code should work if you are using the default WordPress post loop (this is not a part of the GP theme).

    Reversing the order isn’t something you can do with CSS unfortunately.

    If you are using Elementor to display your post then you will likely need to check with their support.

    Also just checked your site and it isn’t using GP.

    Let me know if this helps 🙂

    #1087695
    Chris

    Thanks, yes, as I said, I’m slowly migrating a new 2.0 version of the site over to run on GP pro, but that’s still in the final stages of development, hopefully, live shortly!

    #1088064
    Leo
    Staff
    Customer Support

    Sounds good 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.