Advertisement
alzagor

list-category-posts for trine_4column

Apr 26th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.97 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. Plugin Name: List Category Posts - Template
  5. Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
  6. Description: Template file for List Category Post Plugin for Wordpress which is used by plugin by argument template=value.php
  7. Version: 0.9
  8. Author: Radek Uldrych & Fernando Briano
  9. Author URI: http://picandocodigo.net http://radoviny.net
  10. */
  11.  
  12. /* Copyright 2009  Radek Uldrych  (email : verex@centrum.cz), Fernando Briano (http://picandocodigo.net)
  13.  
  14. This program is free software; you can redistribute it and/or modify
  15. it under the terms of the GNU General Public License as published by
  16. the Free Software Foundation; either version 3 of the License, or
  17. any later version.
  18.  
  19. This program is distributed in the hope that it will be useful,
  20. but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. GNU General Public License for more details.
  23.  
  24. You should have received a copy of the GNU General Public License
  25. along with this program; if not, write to the Free Software
  26. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  27. */
  28.  
  29. /**
  30.  * The format for templates changed since version 0.17.
  31.  * Since this code is included inside CatListDisplayer, $this refers to
  32.  * the instance of CatListDisplayer that called this file.
  33.  */
  34.  
  35. /* This is the string which will gather all the information.*/
  36. $lcp_display_output = '';
  37.  
  38. // Show category link:
  39. $lcp_display_output .= $this->get_category_link('strong');
  40.  
  41. //Add 'starting' tag.
  42. // Temporarily halting <div class="entry-content">
  43. // Adding TRINE 4-column wrapper
  44. // Starting list
  45.  
  46. $lcp_display_output .= '</div>';
  47. $lcp_display_output .= '<div class="portfolio-gallery grid-list-four-portfolio clearfix">';
  48. $lcp_display_output .= '<ul>';
  49.  
  50. /**
  51.  * Posts loop.
  52.  * The code here will be executed for every post in the category.
  53.  * As you can see, the different options are being called from functions on the
  54.  * $this variable which is a CatListDisplayer.
  55.  *
  56.  * The CatListDisplayer has a function for each field we want to show.
  57.  * So you'll see get_excerpt, get_thumbnail, etc.
  58.  * You can now pass an html tag as a parameter. This tag will sorround the info
  59.  * you want to display. You can also assign a specific CSS class to each field.
  60.  */
  61. foreach ($this->catlist->get_categories_posts() as $single):
  62.     //Start a List Item for each post:
  63.     $lcp_display_output .= "<li>";
  64.  
  65.     //Adding image wrap
  66.     $lcp_display_output .= '<div class="portfolio-image-wrap">';
  67.  
  68.     //Post Thumbnail
  69.     $lcp_display_output .= $this->get_thumbnail($single);
  70.    
  71.     //Closing image wrap
  72.     $lcp_display_output .= '</div>';
  73.  
  74.     //Show the title and link to the post:
  75.     $lcp_display_output .= $this->get_post_title($single, 'h3');
  76.  
  77.     //Show comments:
  78.     $lcp_display_output .= $this->get_comments($single);
  79.  
  80.     //Show date:
  81.     $lcp_display_output .= ' ' . $this->get_date($single);
  82.  
  83.     //Show author
  84.     $lcp_display_output .= $this->get_author($single);
  85.  
  86.     //Custom fields:
  87.     $lcp_display_output .= $this->get_custom_fields($this->params['customfield_display'], $single->ID);
  88.  
  89.     /**
  90.      * Post content - Example of how to use tag and class parameters:
  91.      * This will produce:<p class="lcp_content">The content</p>
  92.      */
  93.     $lcp_display_output .= $this->get_content($single, 'p', 'lcp_content');
  94.  
  95.     /**
  96.      * Post content - Example of how to use tag and class parameters:
  97.      * This will produce:<div class="lcp_excerpt">The content</div>
  98.      */
  99.     $lcp_display_output .= $this->get_excerpt($single, 'p', 'description');
  100.  
  101.     //Close li tag
  102.     $lcp_display_output .= '</li>';
  103. endforeach;
  104.  
  105. //Closing wrapper.
  106. // Closing list
  107. // Closing TRINE 4-column wrapper
  108. // Restarting <div class="entry-content">
  109. $lcp_display_output .= '</ul>';
  110. $lcp_display_output .= '</div>';
  111. $lcp_display_output .= '<div class="entry-content">';
  112.  
  113.  
  114. $this->lcp_output = $lcp_display_output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement