I'm using Sage 9 WordPress starter theme.https://github.com/roots/sage
After include the template in Laravel Blade and pass some data.
@include ('partials.filter-archive', ['taxonomy' => 'project-type'])
How could I use it in my template partials.filter-archive
?? {{ $taxonomy }}
doesn't seem to work :(
@php
$terms = get_terms(array(
'taxonomy' => {{ $taxonomy }},
'orderby' => 'menu_order',
));
print_r($terms);
@endphp
I solved it
I can actually simply just do this in partials.filter-archive
, that worked for me.
$terms = get_terms(array(
'taxonomy' => $taxonomy,
'orderby' => 'menu_order',
));
print_r($terms);
try this once
@include ('partials.filter-archive', ['taxonomy' => "project-type"]);
and try to do this {{ $taxonomy }} before calling wp function, and check if its getting printed