Well, I am in trouble with WordPress (2.2.1), because this line “<?php if (have_posts()) : while (have_posts()) : the_post(); ?>” does not seems to work anymore.
In short, I am working on the i3Theme to meet the needs of a customer (mostly turning static menus on both sides into dynamic menus + removing commenting features).
The goal is to use the powerful features of WP, to build a “classic” website (not a blog) with data (either posts or pages) shown one by one, which implies the menu(s).
I have used PHP and MySQL for nearly 5 years now (and Oracle a few years before), and the functions I am implementing work fine on other themes of WP 2.2.1,
so I do not think this is due to a lack of experience on my side (except with WP, whose I have used for less than one year).
The links look this way:
https://pouplard.net/~fludor/fr/?p=23
(Note: “https://pouplard.net/~fludor/fr/” is the root of the website, but pouplard.net is an alias of my computer, so you cannot see the trouble on the Net).
Of course, the links exist. I have dropped and rebuilt the database, too, as I thought it was perhaps out of date, but the only change is that now, I get error messages
(until that, I only got an empty #content zone)
In clicking on the URL above (or ANY url with a “?p=xx” suffix), I get this message:
Erreur de la base de données de WordPress : [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY post_date ASC LIMIT 1’ at line 1]
SELECT ID, post_title FROM fr_posts WHERE post_date > ” AND post_type = ‘post’ AND post_status = ‘publish’ AND ID != ORDER BY post_date ASC LIMIT 1
I have noticed that the request is malformed (there is no value at “AND ID !=” !!!), but I was not expecting this query, anyway, because I ask for a post in giving its ID ??
So, I am trying to understand the “internals” of WP (I have difficulties at it — i don’t understand a lot the WP_Query class), and I would like to know how
I can shortcut the “have_posts()/the_post()” block, in order to show the pages/posts I need: either one full page/post, or exerpts of results in case of search…
PS: My plugins are “akismet” and “hello” (they came with WP), plus “wp-db-backup” (added).