Title: Reverse sort?
Last modified: September 24, 2023

---

# Reverse sort?

 *  Resolved [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort/)
 * So I am starting to work on my academic personal website. I’m hoping to use Tablepress
   to help list all my articles. However, traditionally, academics need their work
   always listed in *reverse* chronological order. Is there a way to force this 
   to sort in a reverse order (by year) at least originally without having to move
   items every time something is published?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freverse-sort%2Fpage%2F2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 14 replies - 16 through 29 (of 29 total)

[←](https://wordpress.org/support/topic/reverse-sort/?output_format=md) [1](https://wordpress.org/support/topic/reverse-sort/?output_format=md)
2

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17148839)
 * Hi,
 * ok, I can see the extra column now, which is a great start. To now make the sorting
   work, please try the suggestions from this post and the links therein: [https://wordpress.org/support/topic/date-order-6/#post-9435474](https://wordpress.org/support/topic/date-order-6/#post-9435474)
 * (Here in the forums, I can only provide suggestions and pointers. For more direct
   help, you could look into getting a [TablePress premium plan](https://tablepress.org/pricing/),
   which offers direct priority email support as well.)
 * Best wishes,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17149637)
 * I did use the code from all of those posts you sent the links to… it was already
   placed.
 * The sort column is still appearing despite me telling it to hide column 0 (since
   in a comment you said it starts at 0) for tables 5, 6, 7. All of that was directly
   copy and pasted, just changing table numbers.
 * The nowrap code which is needed for the second column… (column 1) for 5, 6, 7
   is also no longer functioning.
 * Unfortunately, as someone on workman’s comp (215.19/week) who hasn’t been able
   to find paying work for 2.5 years (which is why I am doing the site to help get
   all my stuff together) I can’t afford to pay $80 a year to find out why the code
   which should work to hide columns isn’t working and lines are not breaking.
 * I think at this point the truly easier thing to do would be to create more columns
   then sort by the second.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17149755)
 * Hi,
 * can you please guide me to where exactly you added code like [https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/#post-7656711](https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/#post-7656711),
   taken from the second link in the link that I posted above?
 * I can’t seem to find that anywhere in the page. That’s what is needed (likely
   even without modifications) here.
 * And no worries, I totally understand that a Premium license might not be a fit
   for everyone (even though that would also give you even more helpful features
   for your tables).
 * As for the counting starting with 0: That only applies to the “Custom Commands”
   text field on each table’s “Edit” screen – but not to the “Custom CSS” text area
   on the “Plugin Options” screen. (These are different programming languages, so
   to speak, which is why the behavior is different.)
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17149809)
 * Going into the plugin there is a section called “Plugin Options.” There is a 
   section called “Custom CSS.” That is where it is. The checkmark is checked. I
   hit save on it.
 * I do not know why, but sometimes it takes siteground anywhere from a few minutes
   to a few hours (sometimes a day even) to get some changes to reflect. The mysteries
   of siteground I guess. This is why it takes so long to fix any part of this site.
 * (The Astra free support people found this out too)
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17149860)
 * Hi,
 * I’m afraid that this “Custom CSS” text area is the wrong place for that code 
   from [https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/#post-7656711](https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/#post-7656711).
   As outlined there, this has to go into the “Custom Commands” text field on the“
   Edit” screen of the tables for which you want this sort behavior change.
 * As for that Siteground issue: Yeah, this sounds like caching. I’m not familiar
   with them, but maybe there’s an option to flush caches or something like that?
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17149925)
 * The part that is actually supposed to be doing the sorting ( “order”: [ [ 0, “
   desc” ] ] ) is in the Custom Commands part. That has never been anywhere else.
   It’s working fine on several tables. I just have to remember to change the column
   number if needed.
 * The part about how to hide things ( .tablepress-id-5 .column-0 {
   display: none;}
   as well as the no page break is in the plugin options. Putting that code in the
   custom commands part does not show any changes in the preview. And in other posts
   you implied it went in plugin options which since it looks like a different language,
   it would make sense.
 * Unfortunately, the only manual flush cache option for the host is when I install
   or deactivate a plugin. Otherwise I just wait. Like right now I made some changes
   to the teaching page to see if that looks any better and site ground is taking
   it’s time.
 * I added a column of content to split the dates into start/end and told it to 
   sort by end date which is now the second column/column 1. The content hasn’t 
   been refreshed to see that another column has been added but the commands from
   the Custom Command for sorting is now sorting by semester on the live site. The
   preview is correct but is it still going to look ok on the live site? Who knows…
   Sigh.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17149950)
 * Hi,
 * can you please use the code that I have linked to a few times now?[https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/#post-7656711](https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/#post-7656711)
 * The `"order": [ [ 0, "desc" ] ]` “Custom Command” will only initiated a sort 
   by the first column, when the table is viewed, it does not change which column
   is used. In the CSS, you must use `.column-1` instead of `.column-0` when targetting
   the first column.
 * Best wishes,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17150077)
 * Sir….
 * I have been using your code and have been since we started this conversation.
   I, contrary to what my problems with this would suggest, actually was a web programmer
   for a number of years, building I don’t even know how many websites in the days
   of handcoding. I just did not want to handcode what is likely to eventually be
   10-12 tables (I am at 7 right now) with up to 60+ rows. I don’t have time for
   that type of frustration anymore at my age especially with wordpress and plugins
   making it much easier to do.
 * You claim you can’t see the code that has been updating. That’s due to my host
   taking their sweet time updating, not that I am not doing it. The Astra people
   I spoke to over a few days ran into the same issue.
   I have not been posting all
   of the code here since it is several lines. But I have now copy and pasted this
   all in full into the clinical page’s custom command code and NOTHING has changed
   in the preview. Nothing. No column has sorted from what it was before. Nothing
   has been hidden. Exactly nothing has changed, for better or for worse. At least
   if there was a change of some type (of any type actually), it would be easy to
   debug if that is not what was desired.
 * As far as in the CSS portion, the first column IS listed as column 1 for all 
   of the ones. It has been listed for days like that. Only in the custom portion
   on the edit page did I start at zero.
 * Once the teaching page (which I am trying to fix this the old fashioned way by
   just adding more columns, then sort on the second) updates and still looks good
   on desktop, I might just flip everything that way which will also deal with the
   wrapping issue. It will just stay looking more circa mid-1990s than I would have
   hoped.
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17150436)
 * There is a gremlin somewhere. I cleared out everything instead of Instead of 
   copy and pasting the code and editing it, I hand typed all of the code to make
   things hidden in the plugin options. Exact words. I now have two of the problem
   children partially fixed in the hidden page and sorting. The wordwrap is still
   broken as far as I can tell for column 2 (as 1 is hidden). I am coming back to
   one tomorrow once 1) table 7 is finished, 2) the host clears whatever they are
   doing.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17150598)
 * Hi,
 * I’m not seeing code like
 *     ```wp-block-code
       "columnDefs": [ { "orderData": [ 0 ], "targets": [ 1 ] }, { "visible": false, "targets": [ 0 ]  } ]
       ```
   
 * from my link anywhere on the site…
 * This code will hide column 1 of a table and instruct the sorting to use the data
   of column 1 when column 2 is sorted on.
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17150844)
 * That was on the clinical page (Table 7) I added to just that one from the time
   you sent it and I am to change it though.
 * That being said, I have the sorting for Acting and Classes (Tables 5 and 6) finally
   fine at least in preview. Hidden code is in the CSS, the sorting is in custom
   commands (basically nothing really changed from what I was originally given).
 * Since I now have Table 5 and 6 working at least on the sorting part AND the hidden
   part, I am going to swap out the code to see if I can’t get Table 7 to work properly
   which means by the time that you see this it will legitimately not be there. (
   Which so far in preview it is looking completely perfect.)
 * The current code for this was literally present days ago and was not functioning.
   Has to be a gremlin somewhere.
 * I just consolidated all of the no-wrap code together (it was ignoring the code
   for table 5 and 6 and only working on table 7) and I might have fixed it at last.
   I am going to wait for siteground to do whatever and not look at this again for
   another day or two but I am feeling good about this assuming the previews are
   accurate. I have at least four more tables to do by next week.
 * Thank you for your patience.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/3/#post-17152575)
 * Hi,
 * I still don’t see the code from my last reply in the “Custom Commands” for table
   7 (on the page [https://melsmarsh.com/healthcare/](https://melsmarsh.com/healthcare/)).
 * I hope that you’ll be able to get everything set up!
 * Best wishes,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/3/#post-17152816)
 * As I mentioned by the time you got around to responding, it would likely be legitimately
   gone from clinical. It was there for multiple hours and turned out it wasn’t 
   needed. There were just gremlins in the code and one part needed to be condensed.
 * Thank you for your help
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/3/#post-17153805)
 * Hi,
 * sure, no problem!
 * Best wishes,
   Tobias

Viewing 14 replies - 16 through 29 (of 29 total)

[←](https://wordpress.org/support/topic/reverse-sort/?output_format=md) [1](https://wordpress.org/support/topic/reverse-sort/?output_format=md)
2

The topic ‘Reverse sort?’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 33 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/3/#post-17153805)
 * Status: resolved