Skip Navigation

[Resolved] Shortcode inside of theme shortcode

This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by chrisC-25 6 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#876863

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

#877499

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Chris,

Thank you for contacting our support forum.

Could you let me know what kind of input does your shortcode expects? Also could you send the custom code used for your shortcode.

Thanks,
Shane

#877787

Hi,

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.

#879007

Hi,

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.

So how can I get this to work?

Thanks

#879321

I found the issue it had to do with the built in carousal in the theme.