Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter kristabrashear

    (@kristabrashear)

    But I don’t want people to have to look at the mobile friendly version if they don’t want to. Is there a way to turn it off?

    There is no help on that page for this question. I am having the same problem.

    i have the same question

    Thread Starter kristabrashear

    (@kristabrashear)

    Thank you esmi

    Thread Starter kristabrashear

    (@kristabrashear)

    I found the info to solve this problem. For anyone who has the same problem, I went to my functions.php template in the wordpress editor and found ‘the_excerpt’. I simply replaced it with ‘the_content’. I hope this helps someone!

    Thread Starter kristabrashear

    (@kristabrashear)

    thank you so much. it was the plugins. I had to delete the folder. Life saver!! Thank you mar1965.

    Thread Starter kristabrashear

    (@kristabrashear)

    Thank you. It worked!

    Thread Starter kristabrashear

    (@kristabrashear)

    The sql query for search is in /wp-includes/query.php

    // If a search pattern is specified, load the posts that match
                                    if ( !empty($q['s']) ) {
    
                                                    // added slashes screw with quote grouping when done early, so done later
                                                    $q['s'] = stripslashes($q['s']);
                                                    if ( !empty($q['sentence']) ) {
                                                                  $q['search_terms'] = array($q['s']);
    
                                                    } else {
    
                                                                    preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches);
    
                                                                    $q['search_terms'] = array_map('_search_terms_tidy', $matches[0]);
    
                                                    }
    
                                                    $n = !empty($q['exact']) ? '' : '%';
    
                                                    $searchand = '';
    
                                                    foreach( (array) $q['search_terms'] as $term ) {
    
                                                                    $term = esc_sql( like_escape( $term ) );
    
                                                                    $search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
    
                                                                    $searchand = ' AND ';
    
                                                    }
    
                                                    if ( !empty($search) ) {
    
                                                                    $search = " AND ({$search}) ";
    
                                                                    if ( !is_user_logged_in() )
    
                                                                                    $search .= " AND ($wpdb->posts.post_password = '') ";
    
                                                    }
    
                                    }

    And in wp-content/themes/quote/inc/improved-search.php it’s the code that will search in topics and authors

    <?php
    
    // search all taxonomies, based on: https://projects.jesseheap.com/all-projects/wordpress-plugin-tag-search-in-wordpress-23
    
    function taxonomies_search_groupby($groupby){
    
      global $wpdb;
    
      // we need to group on post ID
    
      $groupby_id = "{$wpdb->posts}.ID";
    
      if(!is_search() || strpos($groupby, $groupby_id) !== false) return $groupby;
    
      // groupby was empty, use ours
    
      if(!strlen(trim($groupby))) return $groupby_id;
    
      // wasn't empty, append ours
    
      return $groupby.", ".$groupby_id;
    
    }
    
    function taxonomies_search_join($join){
    
      global $wpdb;
    
      if (is_search())
    
        $join .= "LEFT JOIN {$wpdb->term_relationships} tr ON {$wpdb->posts}.ID = tr.object_id INNER JOIN {$wpdb->term_taxonomy} tt ON tt.term_taxonomy_id=tr.term_taxonomy_id INNER JOIN {$wpdb->terms} t ON t.term_id = tt.term_id";
    
      return $join;
    
    }
    
    function taxonomies_search_where($where){
    
      global $wpdb;
    
      if (is_search())
    
                    $where .= "OR (t.name LIKE '%".str_replace(array(' quotes',' quote'),'',get_search_query())."%' AND {$wpdb->posts}.post_status = 'publish')";
    
      return $where;
    
    }
    
    add_filter('posts_where','taxonomies_search_where');
    
    add_filter('posts_join', 'taxonomies_search_join');
    
    add_filter('posts_groupby', 'taxonomies_search_groupby');
    
    ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

    Thread Starter kristabrashear

    (@kristabrashear)

    it works. thank you so much!

    Thread Starter kristabrashear

    (@kristabrashear)

    or maybe it does….

    Thread Starter kristabrashear

    (@kristabrashear)

    Hi adans_ix. I dont think that version is compatible with the updated wordpress.

    Thread Starter kristabrashear

    (@kristabrashear)

    The sql query for search is in /wp-includes/query.php

    // If a search pattern is specified, load the posts that match
    if ( !empty($q[‘s’]) ) {
    // added slashes screw with quote grouping when done early, so done later
    $q[‘s’] = stripslashes($q[‘s’]);
    if ( !empty($q[‘sentence’]) ) {
    $q[‘search_terms’] = array($q[‘s’]);
    } else {
    preg_match_all(‘/”.*?(“|$)|((?<=[\\s”,+])|^)[^\\s”,+]+/’, $q[‘s’], $matches);
    $q[‘search_terms’] = array_map(‘_search_terms_tidy’, $matches[0]);
    }
    $n = !empty($q[‘exact’]) ? ” : ‘%’;
    $searchand = ”;
    foreach( (array) $q[‘search_terms’] as $term ) {
    $term = esc_sql( like_escape( $term ) );
    $search .= “{$searchand}(($wpdb->posts.post_title LIKE ‘{$n}{$term}{$n}’) OR ($wpdb->posts.post_content LIKE ‘{$n}{$term}{$n}’))”;
    $searchand = ‘ AND ‘;
    }

    if ( !empty($search) ) {
    $search = ” AND ({$search}) “;
    if ( !is_user_logged_in() )
    $search .= ” AND ($wpdb->posts.post_password = ”) “;
    }
    }

    And in wp-content/themes/quote/inc/improved-search.php it’s the code that will search in topics and authors

    <?php
    // search all taxonomies, based on: https://projects.jesseheap.com/all-projects/wordpress-plugin-tag-search-in-wordpress-23
    function taxonomies_search_groupby($groupby){
    global $wpdb;

    // we need to group on post ID
    $groupby_id = “{$wpdb->posts}.ID”;
    if(!is_search() || strpos($groupby, $groupby_id) !== false) return $groupby;

    // groupby was empty, use ours
    if(!strlen(trim($groupby))) return $groupby_id;

    // wasn’t empty, append ours
    return $groupby.”, “.$groupby_id;
    }

    function taxonomies_search_join($join){
    global $wpdb;
    if (is_search())
    $join .= “LEFT JOIN {$wpdb->term_relationships} tr ON {$wpdb->posts}.ID = tr.object_id INNER JOIN {$wpdb->term_taxonomy} tt ON tt.term_taxonomy_id=tr.term_taxonomy_id INNER JOIN {$wpdb->terms} t ON t.term_id = tt.term_id”;
    return $join;
    }
    function taxonomies_search_where($where){
    global $wpdb;
    if (is_search())
    $where .= “OR (t.name LIKE ‘%”.str_replace(array(‘ quotes’,’ quote’),”,get_search_query()).”%’ AND {$wpdb->posts}.post_status = ‘publish’)”;
    return $where;
    }

    add_filter(‘posts_where’,’taxonomies_search_where’);
    add_filter(‘posts_join’, ‘taxonomies_search_join’);
    add_filter(‘posts_groupby’, ‘taxonomies_search_groupby’);

    ?>

    Thread Starter kristabrashear

    (@kristabrashear)

    I would appreciate it so much if you could tell me what the solution would be.

    Thread Starter kristabrashear

    (@kristabrashear)

    I am not sure what the SQL query is. Where would I find it?

    Thread Starter kristabrashear

    (@kristabrashear)

    Thank you! Youre awesome!

Viewing 15 replies - 1 through 15 (of 19 total)