Wird jetzt angezeigt vielen dankt daniel!
Ich habe jetzt noch hier diese Codeschnipsel gefunden mit denen das ganze in EINER Loop zu bewältigen ist, nur weiß ich nicht genau was in die functions.php kommt was ich in die index.php schreiben soll oder man alles direkt in die index schreiben soll. Optimal wäre wenn man es schön aufteilt sodass functions un index sauber bleiben.
Hier die 2 Code schnipsel:
ZitatAlles anzeigen[COLOR=#101094][FONT=inherit]if[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#303336][FONT=inherit] have_posts[/FONT][/COLOR][COLOR=#303336][FONT=inherit]()[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit])[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]{[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#101094][FONT=inherit]global[/FONT][/COLOR][COLOR=#303336][FONT=inherit] $wp_query[/FONT][/COLOR][COLOR=#303336][FONT=inherit];[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
$thumbnail_size [/FONT][/COLOR][COLOR=#303336][FONT=inherit]=[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]'size-after-3-posts'[/FONT][/COLOR][COLOR=#303336][FONT=inherit];[/FONT][/COLOR][COLOR=#303336][FONT=inherit][/FONT][/COLOR][COLOR=#101094][FONT=inherit]while[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#303336][FONT=inherit] have_posts[/FONT][/COLOR][COLOR=#303336][FONT=inherit]()[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit])[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]{[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
the_post[/FONT][/COLOR][COLOR=#303336][FONT=inherit]();[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
[/FONT][/COLOR][COLOR=#858C93][FONT=inherit]// Get the current post's index[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
$current_post [/FONT][/COLOR][COLOR=#303336][FONT=inherit]=[/FONT][/COLOR][COLOR=#303336][FONT=inherit] $wp_query[/FONT][/COLOR][COLOR=#303336][FONT=inherit]->[/FONT][/COLOR][COLOR=#303336][FONT=inherit]current_post[/FONT][/COLOR][COLOR=#303336][FONT=inherit];[/FONT][/COLOR][COLOR=#303336][FONT=inherit][/FONT][/COLOR][COLOR=#858C93][FONT=inherit]// Post index starts from 0 (zero)[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
[/FONT][/COLOR][COLOR=#858C93][FONT=inherit]// 1st post will have big-thumbnail and 2nd & 3rd will have small-thumbnail[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
[/FONT][/COLOR][COLOR=#101094][FONT=inherit]if[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]0[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]===[/FONT][/COLOR][COLOR=#303336][FONT=inherit] $current_post [/FONT][/COLOR][COLOR=#303336][FONT=inherit])[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]{[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
$thumbnail_size [/FONT][/COLOR][COLOR=#303336][FONT=inherit]=[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]'big-thumbnail'[/FONT][/COLOR][COLOR=#303336][FONT=inherit];[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
[/FONT][/COLOR][COLOR=#303336][FONT=inherit]}[/FONT][/COLOR][COLOR=#303336][FONT=inherit] elseif [/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]1[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]===[/FONT][/COLOR][COLOR=#303336][FONT=inherit] $current_post [/FONT][/COLOR][COLOR=#303336][FONT=inherit]||[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]2[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]===[/FONT][/COLOR][COLOR=#303336][FONT=inherit] $current_post [/FONT][/COLOR][COLOR=#303336][FONT=inherit])[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]{[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
$thumbnail_size [/FONT][/COLOR][COLOR=#303336][FONT=inherit]=[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]'small-thumbnail'[/FONT][/COLOR][COLOR=#303336][FONT=inherit];[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
[/FONT][/COLOR][COLOR=#303336][FONT=inherit]}[/FONT][/COLOR][COLOR=#303336][FONT=inherit][/FONT][/COLOR][COLOR=#858C93][FONT=inherit]// Now we have the proper thumbnail size[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
the_post_thumbnail[/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#303336][FONT=inherit] $thumbnail_size [/FONT][/COLOR][COLOR=#303336][FONT=inherit]);[/FONT][/COLOR][COLOR=#303336][FONT=inherit]
[/FONT][/COLOR][COLOR=#303336][FONT=inherit]}[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]}[/FONT][/COLOR]
Zweite Version mit der man es anscheinend machen kann:
ZitatAlles anzeigen[TABLE="class: highlight tab-size js-file-line-container, width: 838"]
[tr][/tr][tr]
[TD="class: blob-code blob-code-inner js-file-line"]<?php $post_counter [COLOR=#D73A49]=[/COLOR] [COLOR=#005CC5]0[/COLOR]; [COLOR=#6A737D]// start a counter before the loop [/COLOR]?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]<?php [COLOR=#D73A49]if[/COLOR] ( have_posts() ) : ?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] <?php [COLOR=#D73A49]while[/COLOR] ( have_posts() ) : the_post(); ?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] <?php $post_counter[COLOR=#D73A49]++[/COLOR]; [COLOR=#6A737D]// increment the counter for each post [/COLOR]?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] <[COLOR=#22863A]article[/COLOR] <?php post_class(); ?> [COLOR=#6F42C1]id[/COLOR]=[COLOR=#032F62]"layout-<?php[COLOR=#24292E] [COLOR=#005CC5]echo[/COLOR] $post_counter; [/COLOR]?>"[/COLOR]>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] <?php [COLOR=#D73A49]if[/COLOR] ( $post_counter [COLOR=#D73A49]<=[/COLOR] [COLOR=#005CC5]3[/COLOR] ) : ?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] // display something only for the third post in the loop[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] <?php [COLOR=#D73A49]endif[/COLOR]; ?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] // the loop content goes here[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] </[COLOR=#22863A]article[/COLOR]>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] <?php [COLOR=#D73A49]endwhile[/COLOR]; ?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]<?php [COLOR=#D73A49]else[/COLOR] : ?>[/TD][/tr][tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"] // not found page[/TD][/tr]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]<?php [COLOR=#D73A49]endif[/COLOR]; ?>[/TD]
[/TABLE]
Bin für lösungsvorschläge oder auch ansätze sehr dankbar.
Danke!