I am trying to:
I created a template to use for my custom posts. I want to call a certain content block on the page based on a selection made in a post field I created. It was working fine, then stopped. I have made this shortcode:
[uncode_block id="[types field='you-might-also-like' output='raw'][/types]"]
Link to a page where the issue can be seen: hidden link
I expected to see:
A rotating carousel under "You Might Also Like"
Instead, I got:
: array_key_exists() expects parameter 2 to be array, null given in on line : Invalid argument supplied for foreach() in on line : array_keys() expects parameter 1 to be array, null given in on line : Invalid argument supplied for foreach() in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line : Invalid argument supplied for foreach() in on line : array_keys() expects parameter 1 to be array, null given in on line : Invalid argument supplied for foreach() in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line : array_key_exists() expects parameter 2 to be array, null given in on line
When I build the template I use WP Bakery to load the carousal that is built into the Uncode theme. Then I stop using the WP Bakery and see this code:
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/1"][uncode_block id="67284"][/vc_column][/vc_row]
I then enter the Toolset Short code where it says id="6784" so it looks like this:
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/1"][uncode_block id="[types field='you-might-also-like' output='raw'][/types]"][/vc_column][/vc_row]
The strange thing is I had at working for awhile, not sure what happened.
I think I have narrowed it down to a problem with the custom post. If I make a content block carousal and query a post type called "releases" it works. If I point the carousal to query my post type "craft-releases" it does not work. I created "craft-releases" after getting help to use the toolset template with the Uncode theme. That topic is here: https://toolset.com/forums/topic/the-theme-uncode-does-not-play-nice-with-toolset/
Here is an example, on this page hidden link
where you see the first time "Craft Discography" shows up I am using a query to "releases" and it works. Below that you see "Craft Discography" and I am using a query to "craft-releases" and it does not work.