Hallo ihr Lieben,
ich bin leider kein PHP Experte und suche mir aus dem Netz zurecht was funktionieren könnte. Leider bin ich dabei jetzt auf ein Problem gestoßen. Ich habe mit Hilfe eines Tutorials einen custom post type und taxonomies angelegt. Der post type ist praxisbeispiele, die taxonomy ist Branche und ich möchte einen Loop, in dem nur die Beiträge aus "Branche" mit dem Tag "fmcgmarke" auftauchen. Leider zeigt die Seite nur den allgemeinen Blogloop an. Kann vielleicht mal jemand drüber schauen, ob er den Fehler findet? Danke.
PHP
<?php $loop = new WP_Query( array( 'post_type' => 'praxisbeispiele', 'Branche' => 'fmcgmarke') ); ?><?php if( have_posts($loop) ) : $i = 0; ?>
<div class="vantage-grid-loop"><div class="drei_Spalten"> <?php while( have_posts() ): the_post(); $i++; ?> <article <?php post_class(array('grid-post')) ?>>
<?php if( has_post_thumbnail() ) : ?> <a class="grid-thumbnail-start" href="<?php the_permalink() ?>" <?php if ( has_post_thumbnail()) { $medium_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'array(336,196)');echo 'style="background: url(' . $medium_image_url[0] . ') no-repeat right top; background-size: cover;background-position: center;" ';} ?>> </a> <?php endif; ?>
<div class="post_rahmen_start"><div class="post-innen"><h3><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3> <div class="excerpt"><?php the_excerpt() ?></div></div></div> </article> <?php if($i % 3 == 0) : ?><div class="clear"></div><?php endif; ?> <?php endwhile; ?> </div></div>
<?php vantage_content_nav( 'nav-below' ); ?>
<?php endif; ?>