Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Joeri Marquerinck

Forum Replies Created

Viewing 3 posts - 11 through 13 (of 13 total)
  • Joeri Marquerinck in reply to:
    Empty result message
    #99939

    Hi,

    It’s strange. When using if ($empty_test > 0) it’s not working. I don’t get the message.

    When using if ($empty_test >= 0) it is working but you also get the message when only a few terms have posts.

    Best regards,
    Joeri.

    Joeri Marquerinck in reply to:
    Empty result message
    #99928

    Hi Trevor,

    I tried this at first and this is working but it gives me a message for every term. And I just want one message when there are no results (when all terms are empty).

    I have use your code so you can check the page for yourself.

    Best regards,
    Joeri.

    Joeri Marquerinck in reply to:
    Empty result message
    #99914

    Hi Trevor,

    Thank you for your reply. I don’t know if you can call it an ‘own results template’ because in the settings you set a class, in my case .list, to show the results when you use the filter. I do have my own template for the loop to show the initial posts. Can I show you this template:

    <?php
    $custom_terms = get_terms('alfabet');
    if (!empty($custom_terms)) {
      foreach($custom_terms as $custom_term) {
      wp_reset_query();
        $args = array(
          'post_type' => 'bontvrijlijst',
          'search_filter_id' => 7242,
          'posts_per_page' => -1,
          'orderby'=> 'title',
          'order' => 'ASC',
          'tax_query' => array(
            array(
              'taxonomy' => 'alfabet',
              'field' => 'slug',
              'terms' => $custom_term->slug,
            ),
          ),
        );
    
        $loop = new WP_Query($args);
        if($loop->have_posts()) {
          echo '<div id="' . $custom_term->slug . '" class="alfabet-letter-wrap"><div class="alfabet-letter">'.$custom_term->name.'</div><ul class="members">';
          while($loop->have_posts()) : $loop->the_post();
            $company_link = get_field('url');
            echo '<li class="member"><a href="'. $company_link .'" target="_blank">'.get_the_title().'</a></li>';
          endwhile;
          echo '</ul></div>';
        }
      }
    } else {
      echo '<p><strong>Er zijn geen bedrijven die voldoen aan deze zoekopdracht. Probeer het opnieuw.</strong></p>';
    }
    ?>

    When there are no results I don’t get the ‘else’ message and in the console I see an error that the main.js file is not found. I don’t know if I can use a link in the reply message but the page is: http://joemarque.nl/dev/bvd/bontvrijlijst-test/.

    Maybe you can see what I am doing wrong.

    Best regards,
    Joeri.

Viewing 3 posts - 11 through 13 (of 13 total)