Forum
Passing Page Attribute into php variable
Hi Guys,
my second question this day, sorry for that.
I need to pass a page attribute into a php-variable, like:
$currentpage = perch_page_attribute('id');
Problem is, that the value is not written into the variable but straight to the html.
i found this searching the forum, whit works fine for the page title but not for a custom attribute:
$currentpage = perch_pages_attribute('id', array('raw' => 'true'), true);
Can anybody help me, please? (i'm very new into php, just now very basic stuff!)
Best Manuel
That would be correct:
Can you show us the code that isn't working?
The not working code was exact this:
Result was this:
But your code worked just fine. Thanks for that!