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.

OK, I'm sure some WP pros here will think this is a dumb question, and I'll probably get some flak, but I have actually read plenty of documentation, and I just don't think I'm even going in the right direction, anymore.

I am somewhat experienced with PHP, but i have little experience with wordpress.

My client bought a WP theme-- and the theme has a built-in template for posts -

However, when I used the suggested method query_posts() - the template was stripped from the post content when displayed on the page.

SO, what methods do I use to include the other parts of the template? I've checked a few files like posts.php and post_template.php -- but it seems like I'm not even going in the right direction.

So whatever help anyone can offer would be fantastic-- I think if I got going in the right direction, I could figure out the trickier details, like how to include aspects of the template only once, even though I want to display 5 posts at a time on this page-- But if you know something different has to be done for that, then I REALLY appreciate the help.

share|improve this question
1  
what theme? what are you trying to achieve? –  Michael May 17 '13 at 21:25
1  
As written, this isn't an answerable question. We don't know what code you're using, what exactly you're trying to accomplish, and what isn't working as expected/intended. Please edit your question to include actual template code, along with a more explicit statement regarding what you're trying to accomplish. –  Chip Bennett May 17 '13 at 21:31
    
@Micheal -- Well, I would post the site, but its a shitty site, although it is exactly what the client asked for. They have a Page -- that they want to be their "blog" page -- and they have a template-- Destro.Pro -- that they want to use for their Posts -- And they want 5 posts at a time-- which, isn't too hard to achieve with query_posts() -- but they want the theme they paid for to be included in the post's format. Like I said, I am inexperienced with WP and I am not sure how to do that. I really wish they had let me do the site from the ground up. Does that answer your question? =/ –  rm-vanda May 17 '13 at 22:58
    
@ChipBennett -- AH, crap, ok. I will edit my question to your spec. I truly apologize-- I don't mean to be that idiot -- I will rephrase this, tomorrow, and I hope you revisit this and give me the valuable input that you want to give, but I was not competent enough to allow you to input. I deeply apologize, and I sincerely thank you for giving me criteria to sharpen my question. Duly noted, and I will keep that in mind for all of my future stackexchange questions. Sincere thanks to both of you -- –  rm-vanda May 17 '13 at 23:01

1 Answer 1

up vote 2 down vote accepted

query_posts() is a horrible function and shouldn't be used. Also it doesn't has much to do with loading template, since it was originally designed to be used in template. Should not be used.

If you are looking for logic of how WP picks template files from theme to load see Template Hierarchy.

If you just want to load some [part of] template manually, get_template_part() is probably what you are looking for.

share|improve this answer
    
Wonderful! This is likely the new direction I was hoping someone would guide me towards -- I am going to let this question ferment a few days-- and once I investigate this more, I will have more concise feedback to give-- And I hope you will add more input in a day or two. –  rm-vanda May 17 '13 at 23:07

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.