Title: Shortcode &#8211; additional parameters
Last modified: February 25, 2020

---

# Shortcode – additional parameters

 *  Resolved [bsmolyanov](https://wordpress.org/support/users/bsmolyanov/)
 * (@bsmolyanov)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/shortcode-additional-parameters/)
 * Hello and congrats for the excellent plugin!
 * We use the post-to-post functionality and it seems to work very well.
 * Is there a way to display additional information about the connected posts using
   the shortcode, e.g. connected post excerpt and author?
 * So far we get list of post titles, including links.
 * Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Anh Tran](https://wordpress.org/support/users/rilwis/)
 * (@rilwis)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-additional-parameters/#post-12526300)
 * Hi [@bsmolyanov](https://wordpress.org/support/users/bsmolyanov/) ,
 * Thanks for your kind words!
 * Yes, it’s possible to output other details of the connected posts. If you use
   a snippet that is similar to the [documentation](https://docs.metabox.io/extensions/mb-relationships/#getting-connected-items),
   then you can see, it’s just a standard WordPress loop. So you can use normal 
   WordPress functions such as “the_title()” and “the_content()” to output these
   details.
 *  Thread Starter [bsmolyanov](https://wordpress.org/support/users/bsmolyanov/)
 * (@bsmolyanov)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-additional-parameters/#post-12560598)
 * Thank you so much for your reply. We need a bit more hand here.
 * We use this code in the functions.php file:
 *     ```
       add_action( 'mb_relationships_init', function() {
           MB_Relationships_API::register( [
               'id'         => 'posts_to_pages',
               'from'       => 'post',
               'to'         => 'post',
           ] );
       } );
       ```
   
 * and we use this shortcodes in the body of the post:
 *     ```
       [mb_relationships id="posts_to_pages" direction="from" mode="ul"]
       [mb_relationships id="posts_to_pages" direction="to" mode="ul"]
       ```
   
 * These settings provide nice list of ‘from’ and ‘to’ post titles, whicih include
   links to the specific posts.
 * We just need to display the posts excerpts below each post title.
 * Do we need to add something in the functions.php file or do we need to add something
   to the shortcode? If yes, could you please write it.
 * Maybe something like this, but where to put it if its correct at all?
 *     ```
       <?php
       $my_excerpt = get_the_excerpt();
       echo $my_excerpt;
       ?>
       ```
   
 * Thank you very much!
    -  This reply was modified 6 years, 2 months ago by [bsmolyanov](https://wordpress.org/support/users/bsmolyanov/).
    -  This reply was modified 6 years, 2 months ago by [bsmolyanov](https://wordpress.org/support/users/bsmolyanov/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Shortcode – additional parameters’ is closed to new replies.

 * ![](https://ps.w.org/mb-relationships/assets/icon-128x128.png?rev=1813195)
 * [MB Relationships](https://wordpress.org/plugins/mb-relationships/)
 * [Support Threads](https://wordpress.org/support/plugin/mb-relationships/)
 * [Active Topics](https://wordpress.org/support/plugin/mb-relationships/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mb-relationships/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mb-relationships/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bsmolyanov](https://wordpress.org/support/users/bsmolyanov/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-additional-parameters/#post-12560598)
 * Status: resolved