Page permalinks in WordPress

Got myself puzzled for a bit while slicing a WordPress theme this weekend on how to get a permalink to a certain page in WordPress template, given that you know what's page title. Use this:

 
<?php echo get_permalink(get_page_by_title("Page title here")->ID); ?>
 

So now in your template you can use like this:

 
<a href="<?php echo get_permalink(get_page_by_title("About")->ID); ?>">About</a>
 


Tags: , ,

Monday, May 3rd, 2010 PHP, Web Design

You might also like

Why Design Your Own WordPress Theme? If your site runs in Wordpress, then you will have no doubt already encountered the concept of using...
Output specific post from a category in WordPress Let's say you slice a website and need a nicely looking block in a sidebar with one recent post from...
WordPress: drop-down pages menu with jQuery magic Using Wordpress as a content management system (CMS) for a web site is a great idea. You get both - static...
Simulating high-traffic for Linode VPS via LoadImpact Thanks to the opportunity given to me by guys from LoadImpact.COM i recently tested my Linode 512 MB...

No comments yet.

Leave a comment

About


Oleksiy Deverishchev is a freelance web developer living in New York City. In this blog he shares his experience with various gadgets and web technologies.

He is available for the following gigs:
  • Microsoft Access projects
  • website design and re-design services
  • php/MySQL developement
  • Java and Grails development
  • virtual private server (VPS) migration, setup and tune-up

For more information and hiring availability please send an email to alex@webandblog.com

Advertisment

Read more

Recent works / current clients

  • BellatAuto Inc - New York / New Jersey used car auto dealer: design and coding.
  • Colette Maison Lumiere - multimedia artist: design and coding for the CMS.
  • Complete Body & Spa - New York City personal training and gym management company: Wordpress template coding.
  • DaleStyle Blog Dale Sudakoff’s fashion blog: Wordpress template coding.
  • DoctorKalitenko.COM - Sergey Kalitenko : antiaging hollistic doctor performing bioidentical replacement therapy. CMS coding and design.
  • Great Jones Spa - premiere New York City Day Spa: coded and designed website and storefront

I am a Freelancers Union Member

Freelancers Union Member Badge