Yoast Breadcrumbs - Version 0.7.4

Version Description

Download this release

Release Info

Developer joostdevalk
Plugin Icon wp plugin Yoast Breadcrumbs
Version 0.7.4
Comparing to
See all releases

Code changes from version 0.7.3 to 0.7.4

Files changed (3) hide show
  1. readme.txt +1 -1
  2. yoast-breadcrumbs.php +8 -4
  3. yoast-posts.php +13 -10
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://yoast.com/donate/
4
  Tags: rss, footer
5
  Requires at least: 2.2
6
  Tested up to: 2.7
7
- stable tag: 0.7.3
8
 
9
  Easily add breadcrumbs to your template!
10
 
4
  Tags: rss, footer
5
  Requires at least: 2.2
6
  Tested up to: 2.7
7
+ stable tag: 0.7.4
8
 
9
  Easily add breadcrumbs to your template!
10
 
yoast-breadcrumbs.php CHANGED
@@ -2,11 +2,11 @@
2
  Plugin Name: Yoast Breadcrumbs
3
  Plugin URI: http://yoast.com/wordpress/breadcrumbs/
4
  Description: Outputs a fully customizable breadcrumb path.
5
- Version: 0.7.2
6
  Author: Joost de Valk
7
  Author URI: http://yoast.com/
8
 
9
- Copyright (C) 2008, Joost de Valk
10
  All rights reserved.
11
 
12
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -196,13 +196,17 @@ function yoast_breadcrumb($prefix = '', $suffix = '', $display = true) {
196
  $output = $homelink.' '.$opt['sep'].' '.bold_or_not($opt['blog']);
197
  } elseif ( !is_page() ) {
198
  $output = $bloglink.' '.$opt['sep'].' ';
199
- if ( ( is_single() || is_category() || is_tag() || is_date() || is_author() ) && $opt['singleparent'] != 0) {
200
  $output .= '<a href="'.get_permalink($opt['singleparent']).'">'.get_the_title($opt['singleparent']).'</a> '.$opt['sep'].' ';
201
  }
202
  if (is_single() && $opt['singlecatprefix']) {
203
  $cats = get_the_category();
204
  $cat = $cats[0];
205
- $output .= get_category_parents($cat->term_id, true, " ".$opt['sep']." ");
 
 
 
 
206
  }
207
  if ( is_category() ) {
208
  $cat = intval( get_query_var('cat') );
2
  Plugin Name: Yoast Breadcrumbs
3
  Plugin URI: http://yoast.com/wordpress/breadcrumbs/
4
  Description: Outputs a fully customizable breadcrumb path.
5
+ Version: 0.7.4
6
  Author: Joost de Valk
7
  Author URI: http://yoast.com/
8
 
9
+ Copyright (C) 2008-2009, Joost de Valk
10
  All rights reserved.
11
 
12
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
196
  $output = $homelink.' '.$opt['sep'].' '.bold_or_not($opt['blog']);
197
  } elseif ( !is_page() ) {
198
  $output = $bloglink.' '.$opt['sep'].' ';
199
+ if ( ( is_single() || is_category() || is_tag() || is_date() || is_author() ) && $opt['singleparent'] != false) {
200
  $output .= '<a href="'.get_permalink($opt['singleparent']).'">'.get_the_title($opt['singleparent']).'</a> '.$opt['sep'].' ';
201
  }
202
  if (is_single() && $opt['singlecatprefix']) {
203
  $cats = get_the_category();
204
  $cat = $cats[0];
205
+ if ($cat->parent != 0) {
206
+ $output .= get_category_parents($cat->term_id, true, " ".$opt['sep']." ");
207
+ } else {
208
+ $output .= '<a href="'.get_category_link($cat->term_id).'">'.$cat->name.'</a> '.$opt['sep'].' ';
209
+ }
210
  }
211
  if ( is_category() ) {
212
  $cat = intval( get_query_var('cat') );
yoast-posts.php CHANGED
@@ -39,16 +39,19 @@ if (!class_exists('YoastPosts')) {
39
  echo $before_widget.$before_title.$widget_name.$after_title;
40
  echo '<a href="http://yoast.com/"><img style="margin: 0 0 5px 5px;" src="http://yoast.com/images/yoast-logo-rss.png" align="right" alt="Yoast"/></a>';
41
  include_once(ABSPATH . WPINC . '/rss.php');
42
- $rss = fetch_rss('http://feeds.feedburner.com/joostdevalk');
43
- $items = array_slice($rss->items, 0, 2);
44
- ?>
45
- <?php if (empty($items)) echo '<li>No items</li>';
46
- else
47
- foreach ( $items as $item ) : ?>
48
- <a style="font-size: 14px; font-weight:bold;" href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'><?php echo $item['title']; ?></a><br/>
49
- <p style="font-size: 10px; color: #aaa;"><?php echo date('j F Y',strtotime($item['pubdate'])); ?></p>
50
- <p><?php echo substr($item['summary'],0,strpos($item['summary'], "This is a post from")); ?></p>
51
- <?php endforeach;
 
 
 
52
  echo $after_widget;
53
  }
54
  }
39
  echo $before_widget.$before_title.$widget_name.$after_title;
40
  echo '<a href="http://yoast.com/"><img style="margin: 0 0 5px 5px;" src="http://yoast.com/images/yoast-logo-rss.png" align="right" alt="Yoast"/></a>';
41
  include_once(ABSPATH . WPINC . '/rss.php');
42
+ $rss = fetch_rss('http://feeds2.feedburner.com/joostdevalk');
43
+ if ($rss) {
44
+ $items = array_slice($rss->items, 0, 2);
45
+ if (empty($items))
46
+ echo '<li>No items</li>';
47
+ else {
48
+ foreach ( $items as $item ) { ?>
49
+ <a style="font-size: 14px; font-weight:bold;" href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'><?php echo $item['title']; ?></a><br/>
50
+ <p style="font-size: 10px; color: #aaa;"><?php echo date('j F Y',strtotime($item['pubdate'])); ?></p>
51
+ <p><?php echo substr($item['summary'],0,strpos($item['summary'], "This is a post from")); ?></p>
52
+ <?php }
53
+ }
54
+ }
55
  echo $after_widget;
56
  }
57
  }