{"id":16018354,"date":"2022-09-17T00:02:31","date_gmt":"2022-09-17T00:02:31","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/orderby-no-longer-working\/"},"modified":"2022-09-17T00:02:31","modified_gmt":"2022-09-17T00:02:31","slug":"orderby-no-longer-working","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/orderby-no-longer-working\/","title":{"rendered":"Orderby no longer working"},"content":{"rendered":"<p>Hi &#8211; I&#8217;ve been using LCP for years and just noticed that my category listings are no longer sorted alphabetically by category title. I&#8217;m not sure when it changed; maybe when I updated to php8?<\/p>\n<p>WordPress version: 6.0.2<br \/>\nPHP version: 8.0.23<br \/>\nLCP plugin version: 0.87<\/p>\n<p>Shortcode with ID removed:<br \/>\n[catlist id=## post_type=page orderby=title order=asc excerpt=no numberposts=-1 template=listcat_template-lessons-main-subject excludeposts=this]<\/p>\n<p>Template:<\/p>\n<pre><code>\/* This is the string which will gather all the information.*\/\n$lcp_display_output = &#039;&#039;;\n\n\/\/ Show category link:\n$lcp_display_output .= $this-&gt;get_category_link(&#039;strong&#039;);\n\n\/\/Add &#039;starting&#039; tag. \n$lcp_display_output .= &#039;&lt;div class=&quot;noads&quot;&gt;&#039;;\n\n\/**\n * Posts loop.\n * The code here will be executed for every post in the category.\n * As you can see, the different options are being called from functions on the\n * $this variable which is a CatListDisplayer.\n *\n * The CatListDisplayer has a function for each field we want to show.\n * So you&#039;ll see get_excerpt, get_thumbnail, etc.\n * You can now pass an html tag as a parameter. This tag will sorround the info\n * you want to display. You can also assign a specific CSS class to each field.\n *\/\nforeach ($this-&gt;catlist-&gt;get_categories_posts() as $single):\n\n\t\n\t  \/\/Create the header for the title:\n    $lcp_display_output .= &#039;&lt;h4 class=&quot;topic-page-links&quot;&gt;&#039;;\n\t\n\t  \/\/Show the title and link to the post:\n    $lcp_display_output .= $this-&gt;get_post_title($single);\n\t\n\t  \/\/Close the header for the title:\n    $lcp_display_output .= &#039;&lt;\/h4&gt;&#039;;\n\n      \/\/Set the paragraph style for each post:\n    $lcp_display_output .= &#039;&#039;;\n\t\n      \/\/Post Thumbnail\n    $lcp_display_output .= $this-&gt;get_thumbnail($single);\n\t\n    \/\/Show comments:\n    $lcp_display_output .= $this-&gt;get_comments($single);\n\n    \/\/Show date:\n    $lcp_display_output .= &#039; &#039; . $this-&gt;get_date($single);\n\n    \/\/Show author\n    $lcp_display_output .= $this-&gt;get_author($single);\n\n    \/**\n     * Post content - Example of how to use tag and class parameters:\n     * This will produce:&lt;p class=&quot;lcp_content&quot;&gt;The content&lt;\/p&gt;\n     *\/\n    $lcp_display_output .= $this-&gt;get_content($single, &#039;&#039;, &#039;lcp_content&#039;);\n\n  \n    \/**\n     * Post content - Example of how to use tag and class parameters:\n     * This will produce:&lt;div class=&quot;lcp_excerpt&quot;&gt;The content&lt;\/div&gt;\n     *\/\n    $lcp_display_output .= $this-&gt;get_excerpt($single, &#039;&#039;, &#039;lcp_excerpt&#039;);\n\t\n    \/\/Close li tag\n    $lcp_display_output .= &#039;&#039;;\nendforeach;\n\n$lcp_display_output .= &#039;&lt;\/div&gt;&#039;;\n\n\t\n$this-&gt;lcp_output = $lcp_display_output;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-16018354","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16018354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16018354\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16018354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}