[wp-hackers] Custom Post Type

Dan Larkin nitephire at gmail.com
Sun Jan 27 21:51:25 GMT 2008


I'm not sure I understand exactly how I would use the set_query_var()
function for my needs.  I'm also not sure that I explained my needs very
well in my original email.  So, I'll try and clarify a little bit
hopefully.  Take two:

I do not want these special pages to show up under Manage Pages or Manage
Posts.  I do want them to show up when one navigates to the pages'
permalinks.  See, simply changing the 'post_type' of an existing page makes
WP pretty much draw a blank.  Correct me if I'm wrong, but from what I can
tell this is because by default WP only displays posts that have certain
pre-programmed 'post_type' values.  Again, correct me if I'm wrong, but it
seems like using set_query_var() will return only those posts which are of
the special value when used in a separate query.  This isn't what I want to
do at all.  I want the main query that handles usual post and page display
to simply get a little extra code functionality to display posts with other
'post_type' values.

Unfortunately I'm still just in the planning stages of my plug-in, so I
don't have code I can run immediate functionality tests on, but I'd like to
have an idea of how I'm going to implement my main functions before I start
coding them.  I'd like to keep database structure changes as minimal as
possible, so being able to use the existing structures with a little extra
code is what I'm going for.

:: Dan

On 1/27/08, Austin Matzko <if.website at gmail.com> wrote:
>
> On Jan 27, 2008 8:30 AM, Austin Matzko <if.website at gmail.com> wrote:
> > One way you can do this is setting the post_type query variable before
> > the posts are retrieved, say at the "parse_query" action hook, by
> > doing something like *set_query_var('group') or whatever.
>
> *That should be set_query_vary('post_type', 'group');
> _______________________________________________
> 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