The Loop is the heart and soul of WordPress. It is the one that processes each Post and display to the world wide web what’s been cookin’ behind the WordPress admin panel.
Some quick background reading may be beneficial before proceeding further with designing WordPress Loops.
The following are few models of how the Loop could be applied to a WordPress installation. The sample codes are to be implemented in index.php
in a multiple-template theme (the one which has single.php
, category.php
, page.php
, etc) or in home.php
when single-template theme (the one which has only index.php
) is used.
It would be nice if you can include the image sizes in the loop. For example the size of image is depend on the where it display. Let say the on the single.php is fullsize image, otherwize is thumbsize.
Pingback: 编程猪鸡的Geek生活 » The Loop
Pingback: 编程猪鸡的Geek生活 » The Loop
Pingback: The HTML Artist » Blog Archive » links for 2006-01-07
Thanks a lot.
Maybe because of my poor english I haven’t found what I was looking for.
I like to show the last 20 posts on the main page.
the first 10 with other design (excerpt_reloaded) as the following 10 (excerpt).
I solved it with the normal loop for the first ten and with
$posts = get_posts('numberposts=10&offset=10');
for the following 10. But on page 2, this is a problem: there are posts 11-20 and 11-20. Hm.
Thanks for Your answere.
Robert
Pingback: La Web A - » Configurando múltiples asides y miniblogs
Great info, thanx! I would like to sort the order of posts based on a custom field – would i have to use hard-core php to achieve this?
AndreSC,
Yes. I see this question a lot in WP Forum; you may find the answer there.
yes, the question abounds but the answer evades :- (
e.g.
http://wordpress.org/support/topic/45332?replies=13
http://wordpress.org/support/topic/47648?replies=8
it seems its one of those things that are possible in principle but would take more time – for the level of programmer that uses WordPress in stead of building their own CMS from scratch – than the sollution is worth. Just thought it may be a logical avenue of development for your CFGUI.
Thanx for the reply.
AndreSC,
I don’t see easy solution either because of the fact that one post could have multiple custom field.
Joshua, irk! good point, haven’t even thought about that.
Pingback: Nate’s Blog » links for 2006-03-17
I have three installations of WordPress installed.
One in my root directory.
One at /jamesiserman .
One at /christianebrause .
I have a static front page set up on the root directory installation. I would like to display 3 mini loops on it (showing the most recent entry for each blog).
Seems simple enough, but is it possible to refer to loop in a seperate wordpress installation?
James,
You could pull the feeds of the blogs, or set up iframes. The WP forum should be able to help you further.
Pingback: Malaiac attack » Blog Archive » links for 2006-04-11
I’m having a play with WP and one of the things that’s giving a headache is the ability to exclude two or more categories from a loop.
Criteria:
I have categories A to J. I want to display 10 posts, which do not come under category A B or C, i.e. 10 posts from D to J.
(The 10 posts bit is less important than the exclusion bit)
Any ideas?
Typical,
I struggle for ages, then ask… and as soon as I do I have a breakthrough! The trick is to use a counter variable:
=10 ) :
else: ?>
Oops…. the code vanished. I’m sure it’s cleanuppable once you see the raw comment in the database (hope against hope!)
Murk,
Nope, the code was stripped out by WP–never made it to database. Good job in finding the solution, by the way.
Pingback: jetstream » Blog Archive » hacking the wordpress
Pingback: The HTML Artist » Blog Archive » Lingblog - January 2006
Pingback: Note To Self - 1001 WordPression Loops
it would be nice if you can include an example of how we can sort posts.
i’m trying to do this, but its really hard to find informations about this subject.
the idea is to display the posts with the default loop (posts of all categories) and add 3 links to sort the list of posts:
sort by name, sort by date, sort by custom field.
Hiya,
it would be nice to get the excerpts running with images(thumbs), as for now only plugins can do that like the excerpts reloaded, any chance about this?
Pingback: Créez votre thème Wordpress de A à Z !
I am wondering if you can do a query posts to do two different things. First, can you use an include such as
if php query_posts(‘cat1,2&showposts=10’)
include(TEMPLATEPATH . ‘/custom.php’)
and can you use a query posts to have certain categories feature different css styling than others so that posts categorized with “feature” would be with a bright background v. all other posts with a white background?
Jane
Jane,
The answer is yes and yes but I just don’t have the time to elaborate on it. Please ask your question at WordPress Forum.
Pingback: links for 2007-07-29 | MY Vast Right Wing Conspiracy
Pingback: 09/08/07 Reperage AIA & BC at Artistik Intelligence Agency
I’m interested in “Grouped by Category” function but with a category PARENT listing children categories posts.
Really can’t find the way to do that.
You could pull the feeds of the blogs, or set up iframes. The WP forum should be able to help you further.
Pingback: I DoFollow but Sometimes I NoFollow… at WordPress Themes, Plugins, Blog Tips, Make Money Online >> WPthemesplugin.com
Pingback: I DoFollow but Sometimes I NoFollow… | Wp Wordpress
Thanks. This is great info.
This is a great post and have kept it in my bookmarks. Will continue to read it as i’m very new to a lot of the points you mention!
Thanks though, i’m glad some people share good stuff like this!
Pingback: 12 Essential Tips to Build Your First Wordpress Theme
Pingback: 建立第一個Wordpress Themeçš„12個關éµ
Pingback: ::::..مدونة الدرس الأدبي والبØØ« الأكاديمي ..::: » سلسلة تصميم قوالب وورد بريس/ 01
Pingback: Essential Tips to Build Your Wordpress Theme
Pingback: 12 Essential Tips to Build Your First Wordpress Theme | thefirst-online
Pingback: 一路飘啊,飘啊,飘…..» Blog Archive » å»ºç«‹ä½ çš„ç¬¬ä¸€å€‹WordPress Theme
Pingback: Wordpress land - 12 Essential Tips to Build Your First Wordpress Theme
Pingback: links for October 8th through December 8th | studio.pebble
Pingback: WPcodex » Циклы WP (The Loop)
Pingback: Votre propre thème pour votre blog « B_L_O_G de Ben, Roro, Simon
Pingback: å»ºç«‹ä½ çš„ç¬¬ä¸€å€‹WordPress Theme
Would you mind sharing what you used for formatting the code snippets shown in your posts? enscript by any chance? or any other syntax highlighting tool? Thanks for all the info, it’s incredibly useful.
hello,
i’d like to sort articles by month/year AND by category, (i.e. for example, if i have the monthly archive of may 2009, the articles should be sorted beneath headlines with the names of the categories) but if i put some code from your “grouped by category”-page into my archive.php, the sorting by month/year doesn’t function anymore. i think, because the value “monthly” of the variable (x?) does’nt get delivered from a to b (if you understand my scrubby english); i’m not the expert in php to know, where to drill the code.
perhaps an interesting thing for you, too?
greetings!
:)
Pingback: WordPress 主循环|å¼€å‘基础知识|WordPress å¼€å‘| » 弗瑞斯游æˆåŠ-DD456.com
Hi,
I’d like to create a template for showing a static page including related post: for example
a page “Trainings” appearing in the page menu that show the content of the static page “training” AND the list of the post of category “training”.
I guess it is a matter of multiple loop, but I don’t know how to do that.
Can you give me some help?
Thanks