Relation from Post to Recipe
-
My client wants to build a post template that has scroll anchor links to the recipe and video at the beginning of the page. The layout would be like this:
# POST TITLE #
# POST EXCERPT #
# SCROLL LINKS (TO WPRM RECIPE / RECIPE VIDEO) #
# A LOT OF #
# POST CONTENT #
# WPRM RECIPE #
## RECIPE CONTENT ##
## RECIPE VIDEO ##
# … #My approach was to create an extra WPRM template that contains those links using block “Recipe Jump” and “Recipe Jump Video” and embed the template via Shortcode like this:
[wprm-recipe id=“XXX” template=”recipe-anchor-buttons”]The shortcode requires a recipe ID in order to pull the info from the recipe connected to the post. We want this to happen dynamically but I realised that the post doesn’t have a relation with the recipe itself. I was expecting to find a meta field in the post’s post meta entries pointing to the recipe but there is nothing.
I then found out that there is only a connection from the repipe (CPT “wprm_recipe”) to the post via meta key “wprm_parent_post_id”.
Now my questions: Is there a way to have a meta key “wprm_child_post_id” in the post (CPT post) which automatically stores the recipe ID inside the post?
If a meta key in the post is not an option, how else would I be able to query the recipe ID inside a post?My client has the elite bundle and right now we are on version 6.2.0 in our development environment.
- The topic ‘Relation from Post to Recipe’ is closed to new replies.