Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
$myquery['tax_query'] = array(
    'relation' => 'OR',
        'taxonomy' => 'brands',
        'terms' => array('ALL'),
        'field' => 'slug',

        'taxonomy' => 'media',
        'terms' => array('news', 'events'),
        'field' => 'slug',

             if ( have_posts() ) : while ( have_posts() ) : the_post(); 
                    <div class="so-post-hom">
                        <h2 class="post-title-home"> the_title();</h2><br />
                        <h3 class="post-desc">
                         echo esc_html( get_post_meta( get_the_ID(), 'designers', true ) ); 
                    <div class="post-bar">

                        $taxonomies = array('brands','media');
                        $show_link = array
                        ('Chac’late','Sukar Pasha Ottoman Lounge','Aspire Grand Café','El Cigar Lounge','Kunafa Albisana',
                        'le Vesuvio','Lwzaar Seafood Market','Shawarma Albisana','Chaclate','news','events');//list any terms in any taxonomy for which to show link
                        foreach($taxonomies as $taxonomy) {
                         $terms = wp_get_post_terms( $post->ID, $taxonomy );
                        foreach($terms as $term) {
                            if( in_array( $term->name, $show_link )) $flag=true;
                            if('Red Velvet Cupcakery'==$term->name) echo '<a href="/akh/red-velvet/">Go!</a>';
                            if('Sukar Pasha Ottoman Lounge'==$term->name) echo '<a href="/akh/sukar-pasha-ottoman-lounge/">Go!</a>';
                            if('Aspire Grand Café'==$term->name) echo '<a href="/akh/aspire-grand-cafe/">Go!</a>';
                            if('El Cigar Lounge'==$term->name) echo '<a href="/akh/el-cigar-lounge/">Go!</a>';
                            if('Kunafa Albisana'==$term->name) echo '<a href="/akh/kunafa-shawarma-albisana/">Go!</a>';
                            if('le Vesuvio'==$term->name) echo '<a href="/akh/le-vesuvio/">Go!</a>';
                            if('Lwzaar Seafood Market'==$term->name) echo '<a href="/akh/lwzaar/">Go!</a>';
                            if('Shawarma Albisana'==$term->name) echo '<a href="/akh/lwzaar/">Go!</a>';
                            if('Chaclate'==$term->name) echo '<a href="/akh/chaclate/">Go!</a>';
                            if('news'==$term->name) echo '<a href="/akh/news-events/">Go!</a>';
                            if('events'==$term->name) echo '<a href="/akh/news-events/">Go!</a>';
                                <?php endwhile; else: ?>
                                <?php endif; ?>

news,events not showing custom "GO"link


share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.