WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Simple list output mode (4 posts)

  1. carletto0282
    Member
    Posted 1 year ago #

    Hi guys,

    what if I'd like to get a simple link list?

    I mean a list of the connected post not formatted in an ordered/unordered list but just a list of comma-separated links?

    I thought it's something about the "mode" attribute in the shortcode but I can't find any detailed information about it on the plugin's home page.

    Can you help me?

    Thanks
    Regards
    Carlo

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. carletto0282
    Member
    Posted 1 year ago #

    Hi guys,

    while waiting for your answer I made some attempts by myself trying to apply the suggestions you put on the wiki here

    https://github.com/scribu/wp-posts-to-posts/wiki/Actions-and-filters

    I copy the function to the function.php of my theme and then I made a template file named p2p-list-produced_by.php since I create a connection between movies and producers (both custom post types)

    Here is the deal:

    - if I use the standard shortcode

    [p2p_connected type=produced_by mode=ul] or even
    [p2p_connected type=posts_to_pages]

    I get the right result displaying the link of the connected producer but I have some problem with the standard layout because I need a simple link list like

    <a href="xxx">xxx</a>, <a href="xxx">xxx</a>, <a href="xxx">xxx</a>

    instead of

    <ul><li><a href="xxx">xxx</a></li></ul> ...

    so I try to edit the shortcode to use my template file.

    My template file contains just

    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

    And the shortcode I used was

    [p2p_connected type=produced_by mode=list]

    But all I get was:

    <a href=""></a>

    Here comes the nice thing: while I'm using WP-Types and Views to manage custom post types and layouts I tried to use some shortcode in the template file

    <a href="<?php echo do_shortcode('[wpv-post-url]'); ?>"><?php echo do_shortcode('[wpv-post-url]'); ?></a>

    But the weird thing is that what I get in that case is the right name of the producers with no url!!!

    Do you have any suggestion?
    Thanks guys for all your great work with this plugin I hope not to bother

    regards
    Carlo

  3. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    In the development version (1.4.3-alpha), you can do this:

    [p2p_connected type=produced_by mode=inline]
  4. carletto0282
    Member
    Posted 1 year ago #

    Great, I will check it asap

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic