WordPress.org

Ready to get started?Download WordPress

Forums

Related Links
[resolved] Meta box (4 posts)

  1. redone975
    Member
    Posted 1 year ago #

    Is it possible to extend the plugin to acquire a value from a meta box for a custom post type?

    I'd like to use a URL from the meta box instead of the permalink.

    Meta box ID:
    ecpt_wp-pdf-document

    Thanks.

    http://wordpress.org/extend/plugins/related-links/

  2. redone975
    Member
    Posted 1 year ago #

    Anyone?

  3. piffpaffpuff
    Member
    Plugin Author

    Posted 12 months ago #

    the related links function returns an array. every array item also includes the post_id. just make a meta-query with this post_id and the meta-name.

  4. redone975
    Member
    Posted 12 months ago #

    Thanks for the reply... I was able to solve it by using the code similar to this:

    <ul>
    	<?php $related_documents = get_related_links('documents'); ?>
        <?php foreach ($related_documents as $rdocument): ?>
        	<li><a href="<?php echo get_post_meta($rdocument['id'], 'ecpt_wp-pdf-document', true); ?>"><?php echo $rdocument['title']; ?></a></li>
        <?php endforeach; ?>
    </ul>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic