Edit Settings. Version: 2.0.3 Author: Aaron Hodge Silver Author URI: http://springthistle.com/ License: GPL2 Copyright 2011 Aaron Hodge Silver (email : ahs@springthistle.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. 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 */ /* * ahscp_callposts_handler() * gets the post_content & title of the most recent published post in given category * to be used via shortcode only [ahscp_callposts] * @param string shortcode attributes * @returns string with post title and content */ $ahscpsett = array(); function ahscp_callposts_handler($atts) { $out = ''; global $post, $ahscpsett; extract(shortcode_atts(array( 'type' => null, 'category' => null, 'custom_field'=>null, 'title'=>null, 'numberposts'=>1, 'class'=>'post', 'sidebox'=>null, 'sideboxsize'=>'small', 'content_style'=>null, 'separator'=>', ', 'cols'=>1, 'col_item_height'=>260, 'col_item_width'=>320, 'showthumb'=>false, 'thumbsize'=>'medium', 'order'=>'DESC', 'dateformat'=>null, 'orderby'=>'post_date', 'continue_text'=>'Read more »', 'pre_continue_text'=>'', 'linktitle'=>'true', 'template'=>0, 'post_type'=>'post', 'heading'=>null, 'headingtag'=>'h3', ), $atts)); // for backwards compatibility if (empty($type)) $type = $category; if ($separator=='
'.$excerpt.' '.$ahscpsett['pre_continue_text'].''.$ahscpsett['continue_text'].''),$tmpl);
$tmpl = str_replace('%%EXCERPT%%',$excerpt,$tmpl);
$tmpl = str_replace('%%EDITLINK%%',$editlink,$tmpl);
$tmpl = str_replace('%%CATEGORY%%',$ahscpsett['single_cat_name'],$tmpl);
$out .= $tmpl;
}
// Not using a template
else if ($ahscpsett['content_style'] != 'title') {
$out .= '
';
$out .= ''.$ahscpsett['title'].'>';
if ($ahscpsett['showthumb']==true) {
$out .= get_the_post_thumbnail($post->ID, $ahscpsett['thumbsize']);
}
if ($ahscpsett['content_style']=='excerpt') {
if (!empty($post->post_excerpt)) $excerpt = $post->post_excerpt;
// else $excerpt = get_the_excerpt();
else $excerpt = ahscp_excerpt($post->post_content);
$out .= '
');
$out .= $content;
}
$out .= '