0

I'd like to create a custom function to replace query_posts(). This custom function needs to include certain custom post types.

I know that you can use query_posts() and specify post_type array as an argument, but since this particular custom query posts will be used on multiple page templates, I'd like to avoid editing multiple templates when new custom post type is created.

So, I'm looking for something like

mycustom_query_posts($args) to call on my page templates. The question is, how does one create this mycustom_query_posts($args)?

Thanks beforehand!

1 Answer 1

0

Wordpress already did it for you:

WP_Query

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.