WordPress.org

Ready to get started?Download WordPress

Forums

Related Links
[resolved] show Label instead of type (2 posts)

  1. csleh
    Member
    Posted 3 years ago #

    The "type" is funky because I had a page with a similar name. How can I show the Label or the Name of a custom post type?
    I"ve tried
    <?php echo $link["label"]; ?>
    <?php echo $link["name"]; ?>

    no luck.

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

  2. piffpaffpuff
    Member
    Plugin Author

    Posted 3 years ago #

    you need to get the post type object:

    $links = get_related_links();
    foreach($links as $link)
    {
      $type_object = get_post_type_object($link['type']);
      echo $type_object->labels->singular_name;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic