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.

http://css-tricks.com/video-screencasts/

Try to look at this famous site which also powered by wordpress. The content in the loop is different from the single post. It use "dl" element in loop, but not main content in the single post. It something like it has a another brief summary of a post that will only display in loop.

So my trouble is how to display something(include image,article,video embedding) in the loop of multiple post but not display in single post itself, and vice versa.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

you can add additional information to your posts through using post meta:

http://wp.tutsplus.com/tutorials/plugins/how-to-create-custom-wordpress-writemeta-boxes/

If you want to check if Wordpress is going to display just a single post/single page or more, you could use something like this before your loop:

$single_page = false;
if(is_single() || is_page()) $single_page = true;

And then in your loop you can simply write conditional code like:

if($single_page == true) echo 'single page';
share|improve this answer
    
can i have something like the website i given , which use DL element? –  Kent Liau Jul 24 '12 at 17:19
    
I think you have to code it yourself, but a very basic example how you could do it might be this one: pastebin.com/HFRGtwAZ Of course you'd have to integrate the retrieval of meta information and so on... –  lupor Jul 24 '12 at 17:37
    
It will still having the same content, for the website i given , it has totally different content in the loop (just like summary) and the real post in single. Two different content. –  Kent Liau Jul 24 '12 at 17:46
    
You could use something like get_post_custom($post->ID) if you need to load meta information. –  lupor Jul 24 '12 at 18:23

This is what the various theme templates are for. Refer to the Template Hierarchy to learn the context in which each template gets loaded.

Using your question as an example, If your theme consisted of an index.php template file and a single.php template file, index.php would be used for all pages consisting of lists of posts- the main posts page, category pages, tag pages, and single.php would be used for any singular post display.

share|improve this answer

I finalize 2 solution

1.) use the custom excerpt + feature image

2.) use the custom field with the get_post_custom build in wordpress function

share|improve this answer

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.