php - Get variable from get_template_part?
Get the solution ↓↓↓Solution:
Well, you simply have to declare your variable asglobal
:
global $table_name;
$table_name = "CPEL Implementation";
If you want to use it in another template :
global $table_name;
echo $table_name;
Answer
Solution:
The "global" method didn't work for me. (As it is an accepted answer it maybe worked in 2012 but not in 2015?!)
I had to change the get_template_part line to this:
include(locate_template('content.php'));
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: err_ossl_pem_no_start_line
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.