[ hide ]
get_syndication_source() template tag can be used in templates to retrieve the title of the source that a given syndicated post was syndicated from. The value can then be stored for later display or processing through PHP functions in your WordPress templates.
<?php if (is_syndicated()) : ?> <?php $title = get_syndication_source(); ?> <p class="source">This syndicated post originally appeared at <a href="<?php the_syndication_source_link(); ?>"><?php print htmlspecialchars($title); ?></a> on <a href="<?php print get_syndication_permalink(); ?>"><?php the_time('j F Y'); ?></a></p> <?php endif; ?>
This code snippet, when used in the WordPress Post Loop, will display a short notice on all syndicated posts, indicating the source from which this imported copy was originally syndicated.
function get_syndication_source ($original = NULL, $id = NULL)
$original is an OPTIONAL parameter, which determines how FeedWordPress will handle posts from aggregator feeds (feeds which gather together many different items from many different sources, such as feeds produced by Google Reader or by FeedWordPress itself). Aggregator feeds often provide information about the original source of the items that appear on them. So, for example, a post that appears in a Google Reader feed, but originally appeared on
projects.radgeek.com, will include information indicating that the post originally came from “Rad Geek’s Projects.” In that situation:
$originalis set to NULL, or left unspecified, FeedWordPress will default to using the setting under Syndication –> Posts & Links –> Links –> Posts from aggregator feeds to determine whether it should return the title of the Google Reader feed, or “Rad Geek’s Projects.”
$originalis set to TRUE, FeedWordPress will return “Rad Geek’s Projects”
$originalis set to FALSE, FeedWordPress will return the title of the Google Reader feed
$id is an OPTIONAL parameter. If specified, it should contain the numerical ID of the post for which to get the original source title. If
$id is NULL, or not specified, FeedWordPress will return the title of the source for the current post in the Post Loop.
Returns a string containing the text of the title, if FeedWordPress knows the source from which this item was syndicated; NULL if the post was not syndicated.