- This topic has 3 replies, 2 voices, and was last updated 14 years, 11 months ago by imported_Ryan.
-
AuthorPosts
-
December 30, 2009 at 6:04 am #1155AnonymousMember
Hi,
I’m using the Multi-Level Navigation Plugin with WordPress and some of my pages have long titles, like "G20 City Trademark Collaboration and Research". In my menu I want to have shortened names, like "G20 Trademarks" instead.So for some of my pages I have added a custom field called shortname that has the shorter form.
What exactly do I need to change in perhaps the core.php file or whatever, so that in the menu it displays the shortname instead of the title, if the shortname exists that is?
Thanks
December 30, 2009 at 12:53 pm #7484imported_RyanMemberInteresting question this. I actually came up with a way to do this quite easily last night … albeit it will only be quite easy to do if I rewrite a whole bunch of stuff again (which I’m about to start doing shortly).
In the mean time you will need to track down the function, which (I think) is called just pages() in the core.php file. Be aware though that I’m about to release a total rewrite of it shortly (hopefully a beta release within a few weeks perhaps) so your changes won’t be much good for long if you want to keep up with the changes.
My thought from last night would actually allow you to write a plugin for the plugin, so that you could keep updating the core plugin, whilst still using your custom functionality within it. I still haven’t started work on that yet though and I may not even have it ready for the next beta release.
I have a feeling I’ve seen a plugin which can modify page titles too, but I can’t remember where I saw it. Another solution would be to use the custom code option to just write some HTML which would allow you to insert whatever titles you wanted.
EDIT: I think the All in One SEO Pack is actually the plugin which can rewrite those titles. I’m not 100% certain though.
December 31, 2009 at 4:28 am #7485AnonymousMemberWell, the pages() function calls wp_list_pages(…) which only returns the list items with the page names, and from what i gathered reading the wordpress documentation, there’s no function like wp_list_meta_values(meta_key) which would do what we want here. So one would have to write it.
As a quickfix ive doubled the width of the dropdown so as to accommodate the longer titles. So yeah..
January 1, 2010 at 3:19 am #7486imported_RyanMemberDid you see the comment I added after writing my post above?
"Ryan" wrote:EDIT: I think the All in One SEO Pack is actually the plugin which can rewrite those titles. I’m not 100% certain though. -
AuthorPosts
- You must be logged in to reply to this topic.