How to check if Page exists?
-
I am using a page as the front page with
query_posts
as follows:<?php
query_posts('pagename=home');
?>It works great, but I want the blog to revert back to the default 10 posts display automatically, in case there is no Page called home (i.e., the page doesn’t exist).
Is there any way — using conditional tags, or something else — to check if the Page called “Home” exists first and then, if TRUE = serve the query_posts command, if FALSE = serve the default setting?
Hope I am clear about what I want. Thanks in advance! ??
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘How to check if Page exists?’ is closed to new replies.