Skip to content

Commit

Permalink
Ticket #FP-21 - New Features
Browse files Browse the repository at this point in the history
- Enhancement: Added the option to display post types, to display events, appointments, etc. Anything with a post type you can now display
- Enhancement: Added new layout option, Top: Image, Title: Bottom, Excerpt: Last
  • Loading branch information
Sharron Denice committed Jan 2, 2015
1 parent 74bdaa1 commit 87dacaf
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 10 deletions.
12 changes: 10 additions & 2 deletions README.txt
Expand Up @@ -4,7 +4,7 @@ Donate link: http://www.thesoftwarepeople.com/software/plugins/wordpress/feature
Tags: featured posts display gallery slider jquery moving boxes the software people
Requires at least: 3.5.1
Tested up to: 4.1
Stable tag: 1.2.3
Stable tag: 1.2.4
License: Apache v2.0
License URI: http://www.apache.org/licenses/LICENSE-2.0

Expand All @@ -19,7 +19,7 @@ The Software People's (TSP) Featured Posts plugin allows you to add featured pos
Add a `Featured Posts` to posts and pages by using a shortcode inside your text or evaluated from within your theme. You may override page/post `Featured Posts` options with shortcode attributes defined on the plugin's settings page.

* `[tsp-featured-posts]` - Will display posts with the default options defined in the plugin's settings page.
* `[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]` - Will override all attributes defined on the plugin's settings page.
* `[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_type="post" post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]` - Will override all attributes defined on the plugin's settings page.

== Installation ==

Expand Down Expand Up @@ -51,6 +51,10 @@ BEFORE YOU BEGIN: Requires the installation and activation of [TSP Easy Dev Late

== Changelog ==

= 1.2.4 =
* Enhancement: Added the option to display post types, to display events, appointments, etc. Anything with a post type you can now display
* Enhancement: Added new layout option, Top: Image, Title: Bottom, Excerpt: Last

= 1.2.3 =
* Enhancement: Added option to show private posts

Expand Down Expand Up @@ -114,6 +118,10 @@ BEFORE YOU BEGIN: Requires the installation and activation of [TSP Easy Dev Late

== Upgrade notice ==

= 1.2.4 =
Enhancement: Added the option to display post types, to display events, appointments, etc. Anything with a post type you can now display
Enhancement: Added new layout option, Top: Image, Title: Bottom, Excerpt: Last

= 1.2.3 =
Enhancement: Added option to show private posts

Expand Down
8 changes: 7 additions & 1 deletion TSP_Easy_Dev.config.php
Expand Up @@ -128,6 +128,11 @@
'label' => 'Excerpt length (Layouts #1, #2 & #4)',
'value' => 100,
),
'post_type' => array(
'type' => 'INPUT',
'label' => 'Post Type',
'value' => 'post',
),
'post_ids' => array(
'type' => 'INPUT',
'label' => 'Post IDs to display',
Expand Down Expand Up @@ -160,7 +165,8 @@
'Title (top), Image (below,left), Text (right)' => 1,
'Title, Image (left) - Text (right)' => 2,
'Image (left) - Text (right)' => 3,
'Slider' => 4),
'Slider' => 4,
'Image (top), Title (below), Text (below-last)' => 5),
),
'order_by' => array(
'type' => 'SELECT',
Expand Down
6 changes: 3 additions & 3 deletions TSP_Easy_Dev.extend.php
Expand Up @@ -263,7 +263,7 @@ public function display_widget( $fields, $echo = true )
$post_ids = preg_replace( "/(\s+)/", ",", $post_ids ); // replace spaces with commas
}

$args = 'category=' . $category . '&numberposts=' . $number_posts . '&orderby=' . $order_by . '&include=' . $post_ids;
$args = 'post_type=' . $post_type . '&category=' . $category . '&numberposts=' . $number_posts . '&orderby=' . $order_by . '&include=' . $post_ids;

if ($show_private == 'Y')
$args .= "&post_status=publish,private";
Expand All @@ -289,7 +289,7 @@ public function display_widget( $fields, $echo = true )
// get the fields stored in the database for this post
$post_fields = $pro_post->get_post_fields( $ID );

// get determine if the link is external if so set target to blank window
// determine if the link is external if so set target to blank window
// TODO: I don't like passing that entire post object by value
$target = "_self";

Expand All @@ -303,7 +303,7 @@ public function display_widget( $fields, $echo = true )
$permalink = get_permalink( $ID );
$long_title = get_the_title( $a_post );

if ( in_array( $layout, array( 1, 2, 4 ) ) )
if ( in_array( $layout, array( 1, 2, 4, 5 ) ) )
{
// get the bottom content
$content_bottom = apply_filters('the_content','');
Expand Down
37 changes: 37 additions & 0 deletions templates/tsp-featured-posts_layout5.tpl
@@ -0,0 +1,37 @@
<!-- // Center articles on home page -->
<article id="post-{$ID}" class="{$post_class}">
<div id="{$plugin_key}_article" class="layout5" style="{$style}">
<div id="top">
<header class="entry-header">
{if $show_thumb}
<a target="{$target}" href="{$permalink}" title="{$long_title}">{$media}</a>
{/if}
</header><!-- .entry-header -->
<div id="clear"></div>
</div>
<div id="full">
{if $sticky}
<div class="entry-format">{$featured}</div>
{/if}
<div class="entry-title"><a target="{$target}" href="{$permalink}" title="{$long_title}">{$long_title}</a></div>
</div>
<div class="clear"></div>
<div id="full">
<span class="entry-summary">
{if $show_author == 'Y' || $show_date == 'Y'}
<div id="article_about">
{if $show_author == 'Y'}By: {$author_first_name}&nbsp;{$author_last_name}&nbsp;{/if} {if $show_date == 'Y'}Published On: {$publish_date}{/if}
</div>
{/if}
{$full_preview}
</span>
</div>
<div class="clear"></div>
<div class="entry-other" style="padding: 20px 0px 10px 0px;">
{$content_bottom}
</div>
<footer class="entry-meta">
{$edit_post_link}
</footer><!-- .entry-meta -->
</div>
</article><!-- #post-{$ID} -->
8 changes: 5 additions & 3 deletions templates/tsp-featured-posts_shortcode_settings.tpl
Expand Up @@ -20,18 +20,20 @@
<li>Number Posts: <strong>number_posts="5"</strong></li>
<li>Read More Text: <strong>read_more_text="Continue Reading <span class="meta-nav">&rarr;</span>"</strong></li>
<li>Excerpt Length (Layouts #0 & #3): <strong>excerpt_min="60"</strong></li>
<li>Excerpt Length (Layouts #1, #2 & #4[Slider]): <strong>excerpt_max="100"</strong></li>
<li>Excerpt Length (Layouts #1, #2, #4[Slider], #5): <strong>excerpt_max="100"</strong></li>
<li>Post Type: <strong>post_type="post"</strong>(Options: post, varies)</li>
<li>Post IDs: <strong>post_ids="5,3,4"</strong></li>
<li>Category: <strong>category="0"</strong>(Any category ID, 0 returns all categories)</li>
<li>Slider Width: <strong>slider_width="865"</strong></li>
<li>Slider Height: <strong>slider_height="365"</strong></li>
<li>Layout: <strong>layout="0"</strong>(Options: 0, 1, 2, 3, 4)
<li>Layout: <strong>layout="0"</strong>(Options: 0, 1, 2, 3, 4, 5)
<ul style="padding-left: 30px;">
<li>0: Left: Image - Right: Title, Text (Thumbnail)</li>
<li>1: Top: Title - Left: Image - Right: Text (Featured-Medium)</li>
<li>2: Left: Title, Image - Right: Text (Featured-Large)</li>
<li>3: Left: Image - Right: Text (Thumbnail/No title)</li>
<li>4: Slider: Title, Image - Right: Text (Featured-Large)</li>
<li>5: Top: Image, Bottom: Title, Bottom-Last: Text</li>
</ul>
</li>
<li>Order By: <strong>order_by="DESC"</strong>(Options: rand,title,date,author,modified,ID)</li>
Expand All @@ -46,7 +48,7 @@
</ul>
<hr>
A shortcode with all the options will look like the following:<br><br>
<strong>[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]</strong>
<strong>[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_type="post" post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]</strong>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion tsp-featured-posts.php
Expand Up @@ -5,7 +5,7 @@
Description: Featured Posts allows you to <strong>add featured posts with quotes to your blog</strong>'s website. Powered by <strong><a href="http://wordpress.org/plugins/tsp-easy-dev/">TSP Easy Dev</a></strong>.
Author: The Software People
Author URI: http://www.thesoftwarepeople.com/
Version: 1.2.3
Version: 1.2.4
Text Domain: tspfp
Copyright: Copyright � 2013 The Software People, LLC (www.thesoftwarepeople.com). All rights reserved
License: APACHE v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down

0 comments on commit 87dacaf

Please sign in to comment.