Answers for "template file not opening when passing parameters in url wp"

0

send variable to get_template_part

//NEW CLEAN way (WP 5.5.0 >=) of passing variables to template parts 

$data = array('foo'=>'bar');

//add your variables as a third parameter
get_template_part( 'template-parts/file', 'name', $data );

//In the template part itself: (IMPORTANT NOTE: the name of the variable has to be args)
echo $args['foo'];
Posted by: Guest on November-18-2020
0

template file not opening when passing parameters in url wp

//wordpress
do not pass "p" as url parameter.
Posted by: Guest on November-20-2020

Code answers related to "template file not opening when passing parameters in url wp"

Browse Popular Code Answers by Language