hmmm. habe mal ne blöde (vielleicht) frage.
Ich habe einen Loop der mir auf der Suchergebnisseite die normalen Artikel anzeigt aber auch die Ergebnisse eines Custom Post Type. Nun möchte ich folgende IF ELSE Funktion einbauen aber das klappt nicht so wie ich es will. Kann mit da jemand weiterhelfen:
Ich habe derzeit eingebaut:
PHP
<div class="thumbnail">
<?php
if(has_post_thumbnail()) :?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<?php else :?>
<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/articledefault.gif" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /></a>
<?php endif;?>
</div>
Ich brauche aber:
PHP
<div class="thumbnail">
<?php
if(has_post_thumbnail()) :?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<?php elseif ( CUSTOM POST TYPE == "TEST SPORT") :?>
<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/customdefault.gif" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /></a>
<?php else :?>
<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/articledefault.gif" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /></a>
<?php endif;?>
</div>
Wie bekomme ich denn da eine Abfrage nach dem CUSTOM POST TYPE mit rein?
Also hier rein
wenn mein Custom Post Type "TEST SPORT" heißt?
ALTERNATIVE
Kann man den Artikeln der CUSTOM POST TYPE ein festes Thumbnail mitgeben, so dass das beim "Artikel schreiben" sofort rechts als Thumbnail eingefügt wird?