Skip Navigation

[Resolved] How to insert a variable ?

This support ticket is created 8 years 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 1 reply, has 1 voice.

Last updated by Guillaume 8 years ago.

Assisted by: Minesh.

Author
Posts
#391084

Hello hello

Here is the code to display a view in a php file :
$args = array(
'id' => '1111',
'limit' => '3'
);
echo render_view( $args )

If, instead of a static element, for the limit number I want to use a viariable. How can I use it ?

For exemple in another example my filter is "Brand" and I want to use the term of my taxonomy archives for exemple "Adidas". I have this code to display the term in my archive.php page : <?php $taxonomy = get_queried_object(); echo $taxonomy->name; ?>

How can I insert this code into the $args code ?

Thanks

#391196

I found the answer :

I need to replace 'limit' => '3'

by 'limit' => "$taxonomy->name"

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.