Staff Order with Department

This support request was posted in Paeon by orlandpcs

Request ID #2794 In Progress
  • How do I edit the Staff order with the department page? Thanks!

    Hello,

    Thanks for writing. Unfortunately that can’t be made through the theme options. The Department template is a built in page template and WordPress give the order following the dates each element was created, however there are some PHP tweaks you can try in order to get the order from the “Attributes” box.

    I’d recommend you to add the following code in your functions.php file:

    
     
    function nice_deparment_order( $query ) {
        if ( ( $query->is_main_query() ) && ( is_tax( 'department' ) ) ){
                 $query->set( 'orderby', 'menu_order' );
                $query->set( 'order', 'ASC' );
       }
    }
     
    //Hook the function
     
    add_action( 'pre_get_posts', 'nice_deparment_order' );
     
    

    Best,
    Juan.

    Please note that the

    &&

    should be &&

    Best,
    Juan.

    Hi,

    I added that code into my functions.php file and now I cannot access the dashboard or my site.

    This sign comes up: Parse error: syntax error, unexpected ‘;’ in C:\wamp\www\wp-content\themes\paeon\functions.php on line 14

    How can I get back into wordpress to delete it?

    I am unable to log into my wordpress admin. How can this be fixed?

    Hi,

    Thanks for your response.

    Did you see my last message stating the thing to look in the code?

    If I’m not wrong you’re working locally right? You can go to C:\wamp\www\wp-content\themes\paeon\ and open the file functions.php with any text editor, like notepad. Then you’ll need to edit that change I’ve mentioned before.

    Best,
    Juan.

    great. thanks! So && replaces that entire line?

    If you check the first code, you need to find

    &&

    And replace it with &&

    The problem is that the code editor we’re using to show code is not replacing the && as it should, and is showing

    &&

    instead.

    You know how it is when it comes to code. A simple comma breaks everything 😉

    Best,
    Juan.

    Awesome! Got it all fixed. Thanks for all your help!

    Have a great day

    Great 🙂

    Have a nice day you too!

    Best,
    Juan.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server