Welcome to WebmasterWorld Guest from 54.196.232.162

Forum Moderators: ergophobe

Message Too Old, No Replies

Wordpress: get name by ID

     
4:19 pm on Dec 30, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 29, 2003
posts:424
votes: 0


I'm working on building a site using Wordpress as the CMS.
I have categories of 'complex' and 'units'
On the units single page I want to display the Complex that it goes to. I have the complex id defined in a custom field. But I don't know how to get the complex name by using that id.
4:43 pm on Dec 30, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 29, 2003
posts:424
votes: 0


Ok i figured it out. I used the function
$complex_array= get_post( $complex_id, 'ARRAY_A');

and then got it with
$complex_array[post_title];

I wish the ref for wordpress functions was better. it's search function and navigation sucks.

6:59 pm on Dec 30, 2009 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8137
votes: 102


Glad you sorted it. I know what you mean.

site:codex.wordpress.org function_name

search is your friend.