Changeset 500396
- Timestamp:
- 02/04/2012 10:38:24 PM (14 years ago)
- Location:
- simple-series
- Files:
-
- 6 added
- 2 edited
-
tags/1.4.3 (added)
-
tags/1.4.3/readme.txt (added)
-
tags/1.4.3/screenshot-1.png (added)
-
tags/1.4.3/screenshot-2.png (added)
-
tags/1.4.3/screenshot-3.png (added)
-
tags/1.4.3/simpleseries.php (added)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/simpleseries.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-series/trunk/readme.txt
r500389 r500396 5 5 Requires at least: 3.3 6 6 Tested up to: 3.3.1 7 Stable tag: 1.4. 37 Stable tag: 1.4.4 8 8 9 9 An easy to use shortcode for automatically creating and organizing a series list for multiple posts on the same topic with appropriate SEO attributes. … … 39 39 No problem! The "Simple Post Series with SEO!" plugin will always update the series lists in each of your posts whenever you publish a new post. The newest post will always be added to the series in chronological order, by publication date. You can see an example of what it looks like here in my own DrawBot series. 40 40 41 = What if I add one post to multiple series? = 42 43 No problem! Just include a comma between the series titles in the shortcode. It will add your post to each series named and it will display each associatd series list. 44 <ul> 45 <li> Example of just a post in only one series `[simple_series title="This Is My Series Title"]`</li> 46 <li> Example of just a post in only one series `[simple_series title="This Is My Series Title,This Is A Totally Different Series Title!"]`</li> 47 </ul> 48 41 49 = It's a piece of crap! It doesn't work! = 42 50 … … 46 54 47 55 Sure! There are three components to the series list: the DIV wrapper, the title of the series inside SPAN tags, and the list items. This is the exact formatting I use in my blog. If you need something different, just fiddle with the CSS to suit and add them to your stylesheet. 48 <br> `div #mbk_simple_series_wrapper { display:block; }`49 <br> `span #mbk_simple_series_title { font-weight:bold; }`50 <br> `div #mbk_simple_series_wrapper ol li.mbk_simple_series_list_item { font-size:smaller; line-height: 0.8em;}`56 <br> `div.mbk_simple_series_wrapper { display:block; }` 57 <br> `span.mbk_simple_series_title { font-weight:bold; }` 58 <br> `div.mbk_simple_series_wrapper ol li.mbk_simple_series_list_item { font-size:smaller; line-height: 0.8em;}` 51 59 52 60 = Wait! I have more questions! = … … 61 69 62 70 == Changelog == 71 72 = 1.4.4 = 73 * 2/4/2012: Now the plugin supports adding a post to multiple series! Thanks to Dale for the suggestion! 63 74 64 75 = 1.4.3 = -
simple-series/trunk/simpleseries.php
r500058 r500396 4 4 Plugin URI: http://www.MakerBlock.com 5 5 Description: Super simple post series organization 6 Version: 1.4. 37 Date: 02-0 3-20126 Version: 1.4.4 7 Date: 02-04-2012 8 8 Author: MakerBlock 9 9 Author URI: http://www.makerblock.com … … 27 27 // 2. We need to assign a post-meta for this post 28 28 update_post_meta($postID, 'mbk_simple_series', $title); 29 // 3. Find ALL posts with that same post-meta tag, sorted by the publish date 30 $querystr = " 31 SELECT $wpdb->posts.* 32 FROM $wpdb->posts, $wpdb->postmeta 33 WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id 34 AND $wpdb->postmeta.meta_key = 'mbk_simple_series' 35 AND $wpdb->postmeta.meta_value = '$title' 36 AND $wpdb->posts.post_status = 'publish' 37 AND $wpdb->posts.post_type = 'post' 38 AND $wpdb->posts.post_date < NOW() 39 ORDER BY $wpdb->posts.post_date ASC"; 40 $pageposts = $wpdb->get_results($querystr, OBJECT); 41 // 4. Create the title for the series 42 $text = "<div id='mbk_simple_series_wrapper'><span id='mbk_simple_series_title'>$title</span><ol>"; 43 // 4. Create an OL list for the posts - appended to the end of the post 44 for ($i=0; $i<count($pageposts);$i++) 45 { $text .= "<li class='mbk_simple_series_list_item'><a href='". get_permalink($pageposts[$i]->ID) ."' title='". $pageposts[$i]->post_title ."'>". $pageposts[$i]->post_title ."</a></li>"; } 46 $text .= "</ol></div>"; 29 // 3. Let's split up the title, if there were multiple titles 30 $title = explode(",",$title); 31 // 4. Let's create a loop that will run - once for each title. This is NOT the most elegant way to run this query! 32 for ($h=0;$h<count($title);$h++) 33 { 34 $titleh = $title[$h]; 35 // 4.a. Find ALL posts with that same post-meta tag, sorted by the publish date 36 $querystr = " 37 SELECT $wpdb->posts.* 38 FROM $wpdb->posts, $wpdb->postmeta 39 WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id 40 AND $wpdb->postmeta.meta_key = 'mbk_simple_series' 41 AND $wpdb->postmeta.meta_value = '$titleh' 42 AND $wpdb->posts.post_status = 'publish' 43 AND $wpdb->posts.post_type = 'post' 44 AND $wpdb->posts.post_date < NOW() 45 ORDER BY $wpdb->posts.post_date ASC"; 46 $pageposts = $wpdb->get_results($querystr, OBJECT); 47 // 4.b. Create the title for the series 48 $text .= "<div class='mbk_simple_series_wrapper'><span class='mbk_simple_series_title'>$titleh</span><ol>"; 49 // 4.c. Create an OL list for the posts - appended to the end of the post 50 for ($i=0; $i<count($pageposts);$i++) 51 { $text .= "<li class='mbk_simple_series_list_item'><a href='". get_permalink($pageposts[$i]->ID) ."' title='". $pageposts[$i]->post_title ."'>". $pageposts[$i]->post_title ."</a></li>"; } 52 $text .= "</ol></div>"; 53 } 47 54 // 5. Does the user want to delete the post from the series? 48 55 if ($delete == "true")
Note: See TracChangeset
for help on using the changeset viewer.