get_syndication_permalink

Contents

[ hide ]

    The get_syndication_permalink() template tag can be used in templates to retrieve the original URL (permalink) of a post that FeedWordPress has syndicated into your WordPress installation. The value can then be stored for later display or processing through PHP functions in your WordPress templates.

    Sample

     <?php if (is_syndicated()) : ?>
       <?php $url = get_syndication_permalink(); ?>
       <p class="source">This syndicated post originally appeared at <a
       href="<?php print htmlspecialchars($url); ?>"><?php
       the_syndication_source(); ?> on <?php the_date('j F Y'); ?></a></p>
     <?php endif; ?>
    

    This code snippet, when used in the WordPress Post Loop, will display a short notice on all syndicaed posts, linking back to the original post from which this imported copy was syndicated.

    Declaration

     function get_syndication_permalink ($id = NULL)
    

    Parameters

    $id is an OPTIONAL parameter. If specified, it should contain the numerical ID of the post for which to get the original permalink URL. If $id is NULL, or not specified, FeedWordPress will return the permalink for the current post in the Post Loop.

    Return value

    Returns a string containing the URL if FeedWordPress knows the URL of the original post from which this item was syndicated; NULL if the post was not syndicated, or if the source feed did not provide a permalink for the item.

    This page is a Wiki! Log in or register an account to edit.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>