Support › General › Custom Field available for all posts
I would like to create a 'master' custom field ( ex. a text area ) that when filled it will be available for all posts, that is to say it will appear at the end of all posts.
I could just throw the text at the end of the my "content-single.php" post template but I'd like to offer the client the possibility to actually change the text from the backend of the website.
Would this be possible?
I think you can create a settings page. The get the field value from a settings page and show it for all posts in the post template. Get more details on the documentation https://docs.metabox.io/extensions/mb-settings-page/
Thank you. It works great. I managed to render the my text field at the end of the posts using a settings page.
$step1 = rwmb_meta( wysiwyg_6ij16pfr8wx, ['object_type' => 'setting'], 'optname' );
However I have trouble displaying my 'Single Image' custom field.
$step2 = rwmb_meta( single_image_wzsxrnm25hl, ['object_type' => 'setting'], 'optname' );
And what it renders is "array" ....
I have however managed to render my 'single image' custom field when that field is attached to a normal post via:
$large = rwmb_meta('single_image_wzsxrnm25hl', array('size' => 'large'));
echo '<img src="' . $large['url'] . '" />';
but I cannot get it to work when the 'single image' custom field is attached to the 'settings page'
You can add the size setting to the second argument like this
$step2 = rwmb_meta( 'single_image_wzsxrnm25hl', ['object_type' => 'setting', 'size' => 'large'], 'optname' );
echo '<img src="' . $step2['url'] . '" />';
Refer to this topic https://support.metabox.io/topic/settings-page-image-output-stuck-in-150x150-configuration/