Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverse date order #170

Closed
Showcase-Joz opened this issue Aug 26, 2015 · 8 comments
Closed

reverse date order #170

Showcase-Joz opened this issue Aug 26, 2015 · 8 comments

Comments

@Showcase-Joz
Copy link

since update items are now listing in reverse order on date and i cant workout how to return them to the correct order

www.creativestudiosderby.co.uk/indesign-online-course/

@bibz
Copy link
Contributor

bibz commented Aug 27, 2015

The order feature (ascending/descending) seems to be working fine with the test suite.
It is accessible in the widget ("Order": "Ascending" or "Descending") or in the shortcode ("order=ASC" or "order=DESC").

Could you please state the version of LCP you are using?
Have you tried de-activating every single plugin you have?

@Showcase-Joz
Copy link
Author

na, not that simple

[catlist id=49 customfield_display='lesson_time' customfield_display_name='no' template=table instance=3 orderby=title order=ASC numberposts=99 pagination=yes excerpt=yes excerpt_strip=no]"

just updated to latest version too!

i am to still use a plugins folder in the theme folder for adding the template to? ...[childtheme]/plugins/list-catergory-posts/table.php

@bibz
Copy link
Contributor

bibz commented Aug 29, 2015

Can you attach your template too?
I am not sure that the template feature has been fixed, what happens when you use the default template?

@Showcase-Joz
Copy link
Author

<?php
/*
Plugin Name: List Category Posts - Template "table"
Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
Description: Template file for List Category Post Plugin for Wordpress which is used by plugin by argument template=value.php
Version: 0.9
Author: Radek Uldrych & Fernando Briano 
Author URI: http://picandocodigo.net http://radoviny.net
*/

/* Copyright 2009  Radek Uldrych  (email : verex@centrum.cz), Fernando Briano (http://picandocodigo.net)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or 
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

/**
 * The format for templates changed since version 0.17.
 * Since this code is included inside CatListDisplayer, $this refers to
 * the instance of CatListDisplayer that called this file.
 */

/* 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. Here, I'm using an unordered list (ul) as an example:
$lcp_display_output .= '<table class="tg">';

//Add 'starting' tag. Here, I'm using an unordered list (ul) as an example:
$lcp_display_output .= '<tbody>';

/**
 * 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){
  //Start a List Item for each post:
  $lcp_display_output .= '<tr>';

  //Start a List Item for each post:
  $lcp_display_output .= '<th class="tg">';

  //Show the title and link to the post:
  $lcp_display_output .= $this->get_post_title($single, 'h4', 'lcp_post');

  //Show comments:
  $lcp_display_output .= $this->get_comments($single);

  //Show date:
  $lcp_display_output .= ' ' . $this->get_date($single);

  //Show date modified:
  $lcp_display_output .= ' ' . $this->get_modified_date($single);

  //Show author
  $lcp_display_output .= $this->get_author($single);

  //Custom fields:
  $lcp_display_output .= $this->get_custom_fields($single);

  //Close li tag
  $lcp_display_output .= '</th>';

  //Close li tag
  $lcp_display_output .= '</tr>';

  //Start a List Item for each post:
  $lcp_display_output .= '<tr>';

  //Start a List Item for each post:
  $lcp_display_output .= '<td>';

  //Post Thumbnail
  $lcp_display_output .= $this->get_thumbnail($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, 'p', '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, 'div', 'lcp_excerpt');


  // Get Posts "More" link:
  $lcp_display_output .= $this->get_posts_morelink($single);

  //Close li tag
  $lcp_display_output .= '</td>';

  //Close li tag
  $lcp_display_output .= '</tr>';
}

// Close the wrapper I opened at the beginning:
$lcp_display_output .= '</tbody>';

// Close the wrapper I opened at the beginning:
$lcp_display_output .= '</table>';

// If there's a "more link", show it:
$lcp_display_output .= $this->catlist->get_morelink();

//Pagination
$lcp_display_output .= $this->get_pagination();

$this->lcp_output = $lcp_display_output;

@bibz
Copy link
Contributor

bibz commented Aug 29, 2015

Is the content in the right order with the default template?

PS: you should re-activate the plugin on your example website.

@Showcase-Joz
Copy link
Author

did you change the template content order?

i installed the plugin at something like v0.56, altered the template to suit and left it. all working just fine. the only thing i could attribute a potential issue to is a reorder plugin that might have affected the direction of order :/

just to elaborate a little, there are three uses of your plugin in the one site....with the latter two working just fine

http://www.creativestudiosderby.co.uk/indesign-online-course/
http://www.creativestudiosderby.co.uk/photoshop-online-course/
http://www.creativestudiosderby.co.uk/illustrator-online-course/

@bibz
Copy link
Contributor

bibz commented Sep 2, 2015

No, not that I am aware of.
I can only stress you to test the shortcode with increasing feature and then report the results here.
For instance:

  • [catlist id=49 orderby=date order=ASC]
  • [catlist id=49 orderby=date order=DESC]
  • [catlist id=49 orderby=date order=ASC customfield_display='lesson_time' customfield_display_name='no']
  • [catlist id=49 orderby=date order=DESC customfield_display='lesson_time' customfield_display_name='no']

@klemens-st
Copy link
Collaborator

Can be closed. The shortcode shared by @Showcase-Joz seems to be working just fine. No problems with order by title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants