• Resolved maryannk

    (@maryannkelley)


    Hi – I’ve been using LCP for years and just noticed that my category listings are no longer sorted alphabetically by category title. I’m not sure when it changed; maybe when I updated to php8?

    Wordpress version: 6.0.2
    PHP version: 8.0.23
    LCP plugin version: 0.87

    Shortcode with ID removed:
    [catlist id=## post_type=page orderby=title order=asc excerpt=no numberposts=-1 template=listcat_template-lessons-main-subject excludeposts=this]

    Template:

    /* This is the string which will gather all the information.*/
    $lcp_display_output = '';
    
    // Show category link:
    $lcp_display_output .= $this->get_category_link('strong');
    
    //Add 'starting' tag. 
    $lcp_display_output .= '<div class="noads">';
    
    /**
     * Posts loop.
     * The code here will be executed for every post in the category.
     * As you can see, the different options are being called from functions on the
     * $this variable which is a CatListDisplayer.
     *
     * The CatListDisplayer has a function for each field we want to show.
     * So you'll see get_excerpt, get_thumbnail, etc.
     * You can now pass an html tag as a parameter. This tag will sorround the info
     * you want to display. You can also assign a specific CSS class to each field.
     */
    foreach ($this->catlist->get_categories_posts() as $single):
    
    	
    	  //Create the header for the title:
        $lcp_display_output .= '<h4 class="topic-page-links">';
    	
    	  //Show the title and link to the post:
        $lcp_display_output .= $this->get_post_title($single);
    	
    	  //Close the header for the title:
        $lcp_display_output .= '</h4>';
    
          //Set the paragraph style for each post:
        $lcp_display_output .= '';
    	
          //Post Thumbnail
        $lcp_display_output .= $this->get_thumbnail($single);
    	
        //Show comments:
        $lcp_display_output .= $this->get_comments($single);
    
        //Show date:
        $lcp_display_output .= ' ' . $this->get_date($single);
    
        //Show author
        $lcp_display_output .= $this->get_author($single);
    
        /**
         * Post content - Example of how to use tag and class parameters:
         * This will produce:<p class="lcp_content">The content</p>
         */
        $lcp_display_output .= $this->get_content($single, '', 'lcp_content');
    
      
        /**
         * Post content - Example of how to use tag and class parameters:
         * This will produce:<div class="lcp_excerpt">The content</div>
         */
        $lcp_display_output .= $this->get_excerpt($single, '', 'lcp_excerpt');
    	
        //Close li tag
        $lcp_display_output .= '';
    endforeach;
    
    $lcp_display_output .= '</div>';
    
    	
    $this->lcp_output = $lcp_display_output;

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter maryannk

    (@maryannkelley)

    Now that I am looking at it, on another page my excluded categories are no longer excluding using [catlist id=##,-##,-##]

    Also the error log is saying:
    Attempt to read property “ID” on null in /wp-content/plugins/list-category-posts/include/lcp-parameters.php on line 302

    Further research into the original orderby issue indicates that the results are being sorted by date modified rather than the title as specified in the shortcode.

    • This reply was modified 1 year, 7 months ago by maryannk.
    • This reply was modified 1 year, 7 months ago by maryannk.
    Plugin Contributor zymeth25

    (@zymeth25)

    Hi, I recreated the scenario you described but was unable to recreate the issue, everything is working fine on my end. What theme are you using? Have you changed anything else, new plugins perhaps?

    Thread Starter maryannk

    (@maryannkelley)

    Thanks for trying to replicate the issue. Turns out it is a plugin: Feast https://feastdesignco.com/feast-plugin/

    Its “Order categories by modified date” option is overriding the Listcat parameters.

    • This reply was modified 1 year, 7 months ago by maryannk.
    Plugin Contributor zymeth25

    (@zymeth25)

    Thanks, I have added this information to the Compatibility page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Orderby no longer working’ is closed to new replies.