Support » Plugin: Search Everything » Search for Tag Word from post

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey Elvira,

    thanks for reaching out! You can make this possible (but make backups before you change anything and note that it wasn’t meant to work this way!) by going to “Plugins”-> “Editor”-> select Search Everything plugin in the upper right corner, find search-everything.php file, select it and then find the “function se_build_search_tag()” function.
    Replace the $searchand = ' AND '; with the $searchand = ' OR '; :

    function se_build_search_tag() {
    		global $wpdb;
    		$vars = $this->query_instance->query_vars;
    
    		$s = $vars['s'];
    		$search_terms = $this->se_get_search_terms();
    		$exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
    		$search = '';
    
    		if ( !empty( $search_terms ) ) {
    			// Building search query
    			$n = ( $exact ) ? '' : '%';
    			$searchand = '';
    			foreach ( $search_terms as $term ) {
    				$term = addslashes_gpc( $term );
    				if ( $this->wp_ver23 ) {
    					$search .= "{$searchand}(tter.name LIKE '{$n}{$term}{$n}')";
    				}
    				$searchand = ' OR '; <------HERE!!!!
    			}
    			$sentence_term = esc_sql( $s );
    			if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
    				if ( $this->wp_ver23 ) {
    					$search = "($search) OR (tter.name LIKE '{$n}{$sentence_term}{$n}')";
    				}
    			}
    			if ( !empty( $search ) )
    				$search = " OR ({$search}) ";
    		}
    		$this->se_log( "tag where: ".$search );
    		return $search;
    	}

    Check the screenshot for easier navigation.

    Let me know how it goes, take care and have a nice day,
    Petra

    Thread Starter elvira.bekyrova

    (@elvirabekyrova)

    Hi Petra,

    Thank you so much for your answer!

    However, when I opened search-everything/search-everything.php file, found the function “function se_build_search_tag()”, I’ve found out that it already has $searchand = ‘ OR ‘;
    Please see my screenshot:
    http://s29.postimg.org/9v9zqkjzb/search.png

    I’ve never modified any of the files before, so I have this by default, and still I can’t search for “tag + word from post”

    Thanks for your help!

    Elvira

    Hey,

    thanks for getting back to me! A quick question – what’s the plugin version you are using? Also, please check in the plugin’s settings if you have ticked the box next to “Search every tag name”.

    Best,
    Petra

    Thread Starter elvira.bekyrova

    (@elvirabekyrova)

    Hi Petra,

    Thanks for your answer!

    I’m using the version 8.1.2.
    The option “Search every tag name” is ticked in the plug-ins settings.

    Thanks,
    Elvira

    Hey Elvira, thanks for getting back to us & I hope you don’t mind me replying on Petra’s behalf, but would you please be so kind and uninstall our plugin and then install it again, to see if it’s any better (especially that function we were mentioning)?

    I sincerely hope you will see that $searchand = ‘AND ‘; next time you try, but please do let us know if this isn’t the case.

    In any case — I’m looking forward to your reply!

    Best,
    Silvo

    Thread Starter elvira.bekyrova

    (@elvirabekyrova)

    Hi Silvo,

    Thank you very much for your message – reinstallation indeed helped! I edited the function and now I have the functionality that I need. Thank you so much for such an excelent customer service.

    Best regards,
    Elvira

    Hey Elvira, that’s great news, really glad we got our way around the problem, really!

    You are always more than welcome to leave a review of our product on the following link, but only if you really feel like we deserve one (no pressure!): http://wordpress.org/support/view/plugin-reviews/search-everything

    And please do not hesitate to let me know if you have any further questions regarding our plugin or if there’s anything else that’s not completely clear, since I’ll gladly help!

    Take care & have a nice start of the week!

    Best,
    Silvo

    Thread Starter elvira.bekyrova

    (@elvirabekyrova)

    Hi Silvo,

    Sure! I’ve just posted a positive feedback and I did it with a pleasure.
    Thanks once more and hope you’re having a great weekend.

    Elvira

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Search for Tag Word from post’ is closed to new replies.