Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
Version 9
Aleksei Kuzmin
0 points
Beginner
Does anyone know, why I can’t access the $post variable in content-single-listing-auction.php?
It works perfectly in content-listing-auction.php, but not in this file.
The thing I want to accomplish is to pick a current price in content-single-listing-auction.php and echo it, so I could pick it with xmlhttpRequest every second and autorefresh it on my listing page.
Something like this:
require($_SERVER[‘DOCUMENT_ROOT’].’/wp-load.php’);
global $post;
$price_current = get_post_meta($post->ID,’price_current’,true);
echo $price_current;
Does anyone know, why I can’t access the $post variable in content-single-listing-auction.php?
It works perfectly in content-listing-auction.php, but not in this file.
The thing I want to accomplish is to pick a current price in content-single-listing-auction.php and echo it, so I could pick it with xmlhttpRequest every second and autorefresh it on my listing page.
Something like this:
require($_SERVER[‘DOCUMENT_ROOT’].’/wp-load.php’);
global $post;
$price_current = get_post_meta($post->ID,’price_current’,true);
echo $price_current;
But if I try var_dump($post);
It returns NULL.
Members Only Content
This reply is for PremiumPress customers only.
Login NowMembers Only Content
This reply is for PremiumPress customers only.
Login Now