
HeavyMercury
New Member
Hi guys,
I'm working on a review website with Elementor and a tons of addons but currently I'm stuck on a stupid thing. I'd like to show the review score in the post block but I couldn't figured out how to do it. My review score had an id class "notation" and I've found this code to use in php :
<?php
$doc = new DomDocument;
// We need to validate our document before refering to the id
$doc->validateOnParse = true;
$doc->loadHtml(file_get_contents('link.php'));
var_dump($doc->getElementById('div1'));
?>
How do I set the line "file_get_contents" to automatically find the related source post page ? It always shows NULL and that's a little bit frustrating. I know that it is a bit complex but I really need this to work...
Thank you for the future support you'll provide me.
I'm working on a review website with Elementor and a tons of addons but currently I'm stuck on a stupid thing. I'd like to show the review score in the post block but I couldn't figured out how to do it. My review score had an id class "notation" and I've found this code to use in php :
<?php
$doc = new DomDocument;
// We need to validate our document before refering to the id
$doc->validateOnParse = true;
$doc->loadHtml(file_get_contents('link.php'));
var_dump($doc->getElementById('div1'));
?>
How do I set the line "file_get_contents" to automatically find the related source post page ? It always shows NULL and that's a little bit frustrating. I know that it is a bit complex but I really need this to work...
Thank you for the future support you'll provide me.