• Hello,

    Apologize, if this is already stated.. i am new to this plugin.. i dont find what i am looking for.
    I have 2 different post IDs store in a custom field on each different cpt (i.e: People).
    the first post is of WP default post
    the second one is of custom post type say bicycle
    What i need is: When i view the People Post, the 2 post ids of (bicycle and post) pulled from the custom fields and their title, image and content get displayed with a shortcode in sidebar

    Thanks

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter johnibom

    (@johnibom)

    just to add one thing, may be it matters, those custom fields are hidden custom fields starting with _ i.e: _nice_post_id and _nice_bicycle_id

    Plugin Author Eliot Akira

    (@miyarakira)

    You can achieve this with the [pass] shortcode, to pass field values as parameters to [loop]. For example:

    [pass field= _nice_post_id]
      [loop id={_NICE_POST_ID}]
        [field title]
        [field thumbnail]
        [content]
      [/loop]
    [/pass]

    For details, please see the documentation under Advanced -> Pass.

    To display this in a sidebar: under Settings, you can enable “Shortcodes in Text Widget”, then add a text widget to a sidebar, with the code inside.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pull post id and cpt post id from custom field and display them’ is closed to new replies.