Please explain what you mean by ‘php variable’. Is it a Custom Field? If so, you can use it in a query as shown here in the Codex: http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
Thread Starter
MI
(@mariukas)
No, it’s not a custom field. It’s just php variable like:
$total = '5.5'
$total is different on each single.php
Also that number is dynamic sum from different parameters (custom field values, frontend user data (user can vote and change total variable in that way), some other calculations). I suppose that I should write it to db or custom field (and update it each time it is changed?), but the question is – can i get this php variable on index page to use it with wp query?
Thanks
The easiest way to use it in a query would be to place it in a Custom Field.
Thread Starter
MI
(@mariukas)
Yeah. However any ideas how to get it as variable without using custom field or db? Or where is no way to do it?
If it is always in the same format, you should be able to get it after the query, but may not be possible to use it in the query.