I’d like my unique Pages to have a more ‘sexy’ title than merely ‘home’ and ‘portfolio’, but when I change their titles to something more descriptive like ‘my fantastic page all about kitchen units’ then the list of pages in my sidebar changes to show this rather lengthy title.
Can I have ‘sexy’ Page meta titles, but maybe base the sidebar links on the Page slug? I’d rather not use the Links module as my site navigation, as I don’t use it on all my Pages.
In summary, the code collects the value(s) for the custom field key ‘title.’ The second line assigns $title the value of the custom field if it exists, otherwise it sets $title to the regular Page title. Then it echos (displays) it.
Amazing how those custom fields can be used for almost anything…