Get parent page title

Post Reply
User avatar
VanHalen
Jr. Bludit
Posts: 9
Joined: Wed Jun 29, 2016 2:48 pm
Location: The Netherlands

How can i display the Parent page title on a subpage?
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Hi,
try this:

Code: Select all

<?php
	echo $subPage->parentMethod('title');
?>
User avatar
VanHalen
Jr. Bludit
Posts: 9
Joined: Wed Jun 29, 2016 2:48 pm
Location: The Netherlands

It works! thank you.
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

Doesn't work anymore. Any suggestions how to handle this? :)
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

Figured it out

Code: Select all

<?php if($Page->parentKey()) { echo '<a href="'.$pages[$Page->parentKey()]->permalink().'">'.$pages[$Page->parentKey()]->title().'</a> /';}; ?> 
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
Post Reply