Staff Order with Department
This support request was posted in Paeon by orlandpcs
- orlandpcs December 17, 2013 at 8:57 pm
How do I edit the Staff order with the department page? Thanks!
Juanfra Aldasoro December 17, 2013 at 9:05 pmHello,
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.orlandpcs December 17, 2013 at 9:33 pmHi,
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?
orlandpcs December 17, 2013 at 9:49 pmI am unable to log into my wordpress admin. How can this be fixed?
Juanfra Aldasoro December 17, 2013 at 9:52 pmHi,
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.Juanfra Aldasoro December 17, 2013 at 9:57 pmIf 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.orlandpcs December 17, 2013 at 10:03 pmAwesome! Got it all fixed. Thanks for all your help!
Have a great day
You must be logged in to reply to this topic.