Hi Ahn - I'm testing the Mailpoet plugin, and am having a display issue when the a user is redirected back to the site to confirm a newsletter subscription.
Here's the link structure where this is happening:
The page is displaying a blank page with only the following:
// Metabox.io https://docs.metabox.io/displaying-fields/
The following is in my single.php theme file:
$value = rwmb_meta( $field_id );
What's causing this, do you think?
Could you please share full the code of the file
single.php? For example https://pastebin.com/91cF37zN
And the function
rwmb_meta( $field_id ); only works inside the loop. If you want to display the field value outside the loop, please use more arguments like this
rwmb_meta( $field_id, $args, $post_id );
I've added your additional arguments to my theme child's single.php, and it's still not working.
And to refresh your memory, this display issue is coming as a result of a new plugin's auto-generated links (mailpoet3 plugin, btw).
If you display the field outside the loop, please replace the variable
$field_id with the ID of the field, for example, https://docs.metabox.io/fields/text/#sample-code ID is
$args if you do not use any arguments, leave it blank
$post_id with the ID (number) of the post, you can get it when editing the post and see on the URL wp-admin/post.php?post=2482&action=edit
the code would be
rwmb_meta( 'text', '', '2482' );
Hi Long - I get what you're suggesting, but if you take a look at the example I provided originally
it doesn't have a $field_id or $post_id. It's auto-generated by the plugin (I've seen other plugins do this as well).
So as you can see in the link example above, there's neither a $field_id nor a $post_id, right? Then how do I attack this instead? As you can tell, I'm stumped.