Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 0.25 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function get_page_by_name($pagename)
  2. {
  3.         $args = array(
  4.                 'posts_per_page' => 999999,
  5.                 'post_type' => array('profile'),
  6.         );
  7.         $pages = query_posts($args);
  8.        
  9.         foreach ($pages as $page) if ($page->post_name == $pagename) return true;
  10.         return false;
  11. }