Forum Replies Created
-
AuthorPosts
-
Olivier
ParticipantWell, great ๐
Is it possible to see a full example of code that one might use to fetch that data from a post type once the relationship is established via the UI? E.g an example of fetching title, featured image, custom field. The documentation only shows very partial code and I'm willing to figure things out, but I can't even find enough examples to build from or even ask on forums about. So far all I've got is 'learn to code' and I would be happy to learn from an example. Thank you
Olivier
ParticipantI tried adding things like
items="thumbnail"anditems="custom_field_id"to the shortcode, but it doesn't work and my page renders all white.December 8, 2022 at 11:43 PM in reply to: Display Relationship value in GenerateBlocks dynamic data #39616Olivier
ParticipantI understand. The way Relationships is implemented makes it hard to use because it's a different construct that WordPress or any other plugin don't know how to retrieve without custom API code.
I'd like to come back to the idea of outputting the relationship value in a custom field for any given post. You mentioned it may not be necessary because the shortcode is an option, but shortcodes are not useful in many dynamic situations. Is there any way to output the Relationship value in a (hidden) custom field?
It seems to me like it would be an easy solution to most issues - any other plugin able to work with custom fields would be able to retrieve it. The work of talking to the Relationships API would be done internally by Meta Box, but the rest of the WordPress install could simply refer to the relevant custom fields for the relationship value.
Olivier
ParticipantHere is the error header from WordPress:
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.1.1
Active theme: GeneratePress Child (version 0.1)
Current plugin: Meta Box (version 5.6.12)
PHP version 8.0.25Olivier
ParticipantThank you Peter. I posted in another thread but should have probably posted here.
You mentioned that the latest version of Meta Box fixed the issue. What is the latest version? My dashboard still shows Version 5.6.12 and that's the one that caused the error. I see no update available.
I'm using Meta Box Pro but not AIO.
Olivier
ParticipantWhat is the latest version fixing this? My wordpress still shows Version 5.6.12 and that's the one that caused the error
November 29, 2022 at 2:41 AM in reply to: Display Relationship value in GenerateBlocks dynamic data #39376Olivier
ParticipantThanks Peter. For some reason, today the shortcode is working when I insert it manually in the page. It's good to know, unfortunately this is not useful as I'm not able to retrieve it from outside the page (as with a custom field), and I can't rely on users to enter the shortcode manually anyway.
Relationships is one of the reason I purchased Metabox, but it seems like I won't be able to use it :/
November 27, 2022 at 5:25 AM in reply to: Display Relationship value in GenerateBlocks dynamic data #39351Olivier
ParticipantAlso, I have a very basic understanding of coding and am often times able to modify code snippets for my needs. But I don't really know PHP. That said if there is a code snippet I can add via the plugin of the same name, I would be happy to try that.
November 27, 2022 at 5:23 AM in reply to: Display Relationship value in GenerateBlocks dynamic data #39350Olivier
ParticipantThanks Peter.
Is there any way to output the relationship value into a custom field? That way I would be able to retrieve it with GenerateBlocks or any other tool, since custom fields are standard wordpress constructs.
As for the shortcode, I tried it but it doesn't work. Here is my shortcode:
[mb_relationships id="licensee-events" direction="from" mode=โulโ]I constructed the Relationship via the UI, see here: https://imgur.elightup.com/jnCFX40.png
I created a page of the Event post type, I inserted the shortcode between 2 paragraphs so you can see, but it outputs nothing, it's not even in the DOM of the page: https://imgur.elightup.com/JDoHDdD.png
And in case you ask, yes I did select the Relationship during post creation.
Thank you
-
AuthorPosts