Hallo zusammen!
Seitdem ich Permalinks so eingestellt habe, dass ich schöne Links erhalte (ohne die ID, sondern nur mit einem /*wort*), funktioniert meine bisherige Abfrage nicht, die wie folgt ausgesehen hat:
PHP-Code:
[LEFT] [COLOR=#000000] [COLOR=#0000BB]<?php
[/COLOR][COLOR=#007700]if ([/COLOR][COLOR=#0000BB]$page_id[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#DD0000]'2'[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000BB]query_posts[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'page_id=13'[/COLOR][COLOR=#007700]);
while ([/COLOR][COLOR=#0000BB]have_posts[/COLOR][COLOR=#007700]()) : [/COLOR][COLOR=#0000BB]the_post[/COLOR][COLOR=#007700]();
print([/COLOR][COLOR=#DD0000]'<h2>'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]the_title[/COLOR][COLOR=#007700]();
print([/COLOR][COLOR=#DD0000]'</h2>'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]the_content[/COLOR][COLOR=#007700]();
endwhile;
}
if ([/COLOR][COLOR=#0000BB]$page_id[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#DD0000]'48'[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000BB]query_posts[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'page_id=94'[/COLOR][COLOR=#007700]);
while ([/COLOR][COLOR=#0000BB]have_posts[/COLOR][COLOR=#007700]()) : [/COLOR][COLOR=#0000BB]the_post[/COLOR][COLOR=#007700]();
print([/COLOR][COLOR=#DD0000]'<h2>'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]the_title[/COLOR][COLOR=#007700]();
print([/COLOR][COLOR=#DD0000]'</h2>'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]the_content[/COLOR][COLOR=#007700]();
endwhile;
}
[/COLOR][COLOR=#0000BB]?>
[/COLOR] </div>[/COLOR] [/LEFT]
Wie erstelle ich das nun, dass es trotz geänderter Permalinks funktioniert. Vorher sind die URLs über IDs gelaufen, nun laufen sie über ihren Namen.
Also die linke Box hat z.B. die Seiten-ID 48 und die entsprechende rechte Box die Seiten-ID 94.
Ich hoffe, ihr versteht mein Problem.
Meine Einschätzung:
das Abfragen der ID klappt nun nicht mehr, da ich die Permalinks geändert habe.
Die Abfrage ist übrigens in der "page.php", das sollte ja stimmen.