[wp-hackers] get_page_link by page name/slug?
Paul Menard
codehooligans at codehooligans.com
Mon Nov 27 16:06:05 GMT 2006
Just a note about your query. The post_name column is not a unique.
Meaning if you have nested pages that end up with the same post_name
(for whatever reason) your query could pull the wrong one.
Paul
On Nov 27, 2006, at 6:15 AM, Lee Kelleher wrote:
> Yeah, Robin is right... I'm using it in the header/footer of my
> template
> (outside of the loop).
>
> Essentially I wanted a way to link to a page (not a post)
> regardless of the
> permalink structure - but using the slug/name as the reference.
>
> My code works fine, but was more curious if there was a more native
> way
> using the WP-core code?
>
> Regards,
> - Lee
>
> From: "Robin Adrianse" <shorty114 at shorty114.net>
>> To: wp-hackers at lists.automattic.com
>> Date: Sun, 26 Nov 2006 12:33:57 -0800
>> Subject: Re: [wp-hackers] get_page_link by page name/slug?
>> No, I think he's using it not in the loop for the page in
>> question. For a
>> navigation, eg.
>>
>> On 11/26/06, Michael B <miklb.online at gmail.com> wrote:
>> >
>> > Forgive me if I misunderstand, but is the_permalink exactly what
>> you
>> want?
>> > http://codex.wordpress.org/Template_Tags/the_permalink
>> >
>> > <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
>> >
>> >
>> > ~miklb
>> >
>>
>
> --
> Lee Kelleher
> http://leekelleher.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list