Print custom fields content on different sites in my network?

Hi,

How do I print custom fields content on different sites in my network?

On network level I have CustomPress activated and added two custom fields.

On site level (called Wiki) I have now filled in content in the custom fields.

On site level (called Dashboard) I now wish to print the content.

To me it looks like that I can only print the content on my site called Wiki (where the actual input happened) and not on a different site?

I use the PHP embed
<?php echo do_shortcode('[ct id="_ct_radio_57738c6f28a84" property="title | description | value"]'); ?>

  • Predrag Dubajic
    • Support

    Hey Karsten,

    Hope you're doing well today :slight_smile:

    To pull custom fields on different template you will need have this in it:

    global $CustomPress_Core;
    $CustomPress_Core->save_custom_fields( $post_id );

    If you then wish to show specific custom fields from another post you will need to use shortcode like this one:
    [custom_fields_input post_id="post_id"] _ct_selectbox_4cf582bd61fa4, _ct_text_4cfeb3eac6f1f,... [/custom_fields_input]

    This will however not work across network since the shortcode will pull post ID from the current site.

    Also, in the shortcode you mentioned above property attribute can have only one value so you will need to use either title, description or value, not all three.

    Best regards,
    Predrag

  • Karsten
    • Flash Drive

    Hi Predrag,

    Thanks for the fast answer.

    I'm using WPMUDEV Global Site Search, Post Indexer and CustomPress. I now want a custom field in CustomPress to be a part of the Global Site Search result. But that is not possible?

    Cheers

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.