Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter joshuaAtNeglia

    (@joshuaatneglia)

    I’ve found the issue.

    WordPress 3.7
    I believe you are using name__like parameter
    so this is happening:
    name__like
    (string) The term name you wish to match. It does a LIKE ‘%term_name%’ query. This matches terms that contain the ‘name__like’ string. Note: This was changed in WordPress 3.7, when previously name__like matched terms that begin with the string. See ticket #8214.

    ndsailor

    (@ndsailor)

    I’m also looking for a solution to this if anyone has ideas.

    Thanks,
    JW

    ndsailor

    (@ndsailor)

    This is what I hope will be a temporary solution… but it works. Some conditions.

    1. It will only produce a single column list, because it’s not using the plugin at all. It only mimics some of the css.
    2. You cannot use shortcode because it doesn’t use the plugin. You’ll have to insert directly into your template.
    3. I created a custom field to populate the $letter variable
    <?php
    $terms = get_terms('your_taxonomy');
    $letter = get_field('alphabet_letter');
    echo '<div class="multi-column-taxonomy-list">';
    echo '<ul class="multi-column-1">';
       foreach ( $terms as $term ) {
          if ( preg_match("/^$letter/i", $term->name) ) {
             echo '<li><a href="' . get_term_link($term) . '">'. $term->name . '</a></li>';
          }
       }
    echo '</ul>';
    echo '</div>'; 
    
    ?>
    mtombs

    (@mtombs)

    I’ve had the same problem, but I’ve just downloaded the plug-in Get terms name__like which seems to resolve the isssue (for the moment, at least!).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Like is searching for letter within name, not just first letter’ is closed to new replies.