Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Anyone know a way round this?

http://wordpress.org/support/topic/set-draft-page-as-parent

I can't risk publishing as a public-facing system updates periodically from the same install.

share|improve this question
    
I don't see why you'd want to have a non-public parent page The only way in which page hierarchy has any unique meaning is in cases that it's public. If you want this for associative purposes, I'd create a custom hierarchical taxonomy and use that to associate your non-public data (you could even mark it as 'private' instead of 'draft'). –  John P Bloch Oct 27 '10 at 13:49
1  
@John: I found this a problem when I wanted to draft both a parent page and children at the same time. –  e100 Nov 12 '10 at 17:22
    
@John Exactly what e100 said - when trying to build out a hierarchy of pages in draft form before publishing. May not impact a smaller WP site but definitely an issue with larger sites that have many content changes at once. –  nickb Aug 4 '13 at 19:05
add comment

3 Answers

There is one way to do this, but it's kind of wonky. Instead of not publishing the page, you can hide the content.

Make a theme template named HidePageTemplate.php. On the page you want hidden change your template file to whatever you named your template In the template copy the structure of the 404 page. This way the page is published, so the child pages are published, but the content isn't visible.

/* Template Name: Hide Page Template */ get header 404-Not Found get sidebar get footer

share|improve this answer
    
Thanks Eileen. Unfortunately we need to set the templates to load in the correct custom fields for authoring the content (The site uses Custom Field Templates). If I had my way, we would get rid of Custom Field Templates but thats not an option at the moment. –  codecowboy Oct 29 '10 at 8:03
    
I think I'm not entirely understanding what you need to do. I've never used that plugin. Maybe if you could better explain what the "hidden" parent page is supposed to do. WOuld the content from /about appear not on /about but rather on /about/our-team? You can still query all the content from the /about page onto any page you want. Also perhaps this might help, try building your own custom fields, maybe that will solve the problem. The link I used to do this is here sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields –  eileencodes Oct 29 '10 at 14:00
    
Did that help at all? –  eileencodes Nov 1 '10 at 21:45
    
This isn't a great solution if you want to keep the post entirely secret. If your post were to get pulled in a search, it would print out at least the excerpt. –  John P Bloch Nov 15 '10 at 14:04
add comment

This works for me:

add_filter('page_attributes_dropdown_pages_args', 'my_attributes_dropdown_pages_args', 1, 1);

function my_attributes_dropdown_pages_args($dropdown_args) {

    $dropdown_args['post_status'] = array('publish','draft');

    return $dropdown_args;
}
share|improve this answer
1  
Please add some explanation to your answer explaining how it solves the problem. –  Maruti Mohanty Dec 18 '13 at 10:46
    
Nice (and obvious) solution. The filter came up with Version 3.3 I think: github.com/WordPress/WordPress/blob/3.3-branch/wp-admin/… –  David Dec 18 '13 at 11:11
add comment

You can't use unpublished pages as parents (or as a static front page, for that matter).

Eileen has, I think, a very elegant workaround.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.