Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: List Category Posts - Template
- 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.8
- 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
- */
- //Show category?
- if ($atts['catlink'] == 'yes'){
- $lcp_output = '<a href="' . $cat_link . '" title="View the ' . $cat_title . ' category">' . $cat_title . '</a>';
- }else{
- $lcp_output = '';
- }
- $lcp_output .= '<ul class="lcp_catlist">';//For default ul
- //Posts loop:
- foreach($catposts as $single):
- $lcp_output .= '<li><a href="' . get_permalink($single->ID) . '">' . $single->post_title . '</a>';
- //Show comments?
- if($atts['comments'] == yes){
- $lcp_output .= ' (' . $single->comment_count . ')';
- }
- //Style for date:
- if($atts['date']=='yes'){
- $lcp_output .= ' - ' . get_the_time($atts['dateformat'], $single);
- }
- //Show author?
- if($atts['author']=='yes'){
- $lcp_userdata = get_userdata($single->post_author);
- $lcp_output .=" - ".$lcp_userdata->display_name;
- }
- //Show thumbnail?
- if($atts['thumbnail']=='yes'){
- if(has_post_thumbnail($single->ID)){
- $lcp_output .= '<div class="lcp_thumbnail"><a href="' . get_permalink($single->ID) . '">' . get_the_post_thumbnail($single->ID, array('40','40')) . '</a></div>';
- }
- }
- //Show content?
- if($atts['content']=='yes' && $single->post_content){
- $lcpcontent = apply_filters('the_content', $single->post_content); // added to parse shortcodes
- $lcpcontent = str_replace(']]>', ']]>', $lcpcontent); // added to parse shortcodes
- $lcp_output .= '<p>' . $lcpcontent . '</p>'; // line tweaked to output filtered content
- }
- //Show excerpt?
- if($atts['excerpt']=='yes' && !($atts['content']=='yes' && $single->post_content) ){
- $lcp_output .= lcp_excerpt($single);
- }
- $lcp_output .='</li>';
- endforeach;
- $lcp_output .= '</ul>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement