I’m working on an upgrade right now to include custom fields.
@lieska
I have enabled to return strings from the ACF plugin. That is it returns the strings only so it will only work well with custom fields that return text or numbers. If it’s anything complicated you’ll just a long string of gibberish (which is the actual code converted to a string output). So if you’d like to include dates, urls, certain text fields it will work. The argument is include_post_meta='custom_field_1,custom_field_2,custom_field_3 etc…
It is just way too much work to be compatible with all custom field types. Maybe in the future in a premium version of this plugin 🙂
The custom fields generally get surrounded by <span></span> tags. So if you’d like them to be something different and include a class maybe you can add this to your functions.php file, custom plugin or use as plugin to insert the code. Here is an example:
add_filter('netsposts_get_acf_html', 'print_acf_html', 10, 2);
function print_acf_html($fields, $post){
$html = '';
foreach($fields as $field){
$html .= '<div>' . $field['label'] . ': ' . $field['value'] . '</div>';
}
return $html;
}
or even
function print_acf_html($fields, $post){
$html = '<div>';
$html = '<p>';
$html .= $fields['some_field']['label'];
$html .= '</p>';
$html = '<p>';
$html .= $fields['some_field']['value'];
$html .= '</p>';
$html .= '</div>';
return $html;
}
some_field just gets replaced with the name of the custom field, label gets replaced with the label, value with the value, etc…
@lieska
I changed the shortcode argument from:
include_post_meta=
to
include_acf_field=
Thread Starter
lieska
(@lieska)
Great, thank you for these, I will try them in some point! (I ended up in this project using another plugin.)
Thread Starter
lieska
(@lieska)
Broadcast. It is of course different copyiing the post instead of just showing the original.
But this seems to be really difficult issue in WordPress MultiSite installation: how to share a post to multiple sites (without having to copy it).
If you can figure out a real way to have only one original post (cusatom with custom fields) without having to duplicate the post and which is delivered to different sites – it would be a treasure.
So let me see if I completely understand the question. You want to be able to post any post or page from one blog on to another as if it was created on the other site without having to copy it?