• Hi Everyone!

    I found a solution to not equal function [if qs="<qskey>!<qsvalue>"] … [/if]

    On class-core.php change the whole condition_query_string function. This is around line 74. Change the whole function to this.

    private function condition_query_string( $value, $match ) {
    	if( strstr( $value, ':' ) ){
    		list( $qs_key, $qs_value ) = explode( ':', $value );
    
    		$match = ( empty( $match ) ) ? 'exact' : $match;
    
    		# Check if GET value matches given value
    		if ( ! isset( $_GET[ $qs_key ] ) || false === $this->check_value( $_GET[ $qs_key ], $qs_value, $match ) )
    			return false;
    
    		return true;
    	}
    	elseif( strstr( $value, '!' ) ){
    		list( $qs_key, $qs_value ) = explode( '!', $value );
    
    		$match = ( empty( $match ) ) ? 'exact' : $match;
    
    		# Check if GET value doesn't match given value
    		if ( ! isset( $_GET[ $qs_key ] ) || false === $this->check_value( $_GET[ $qs_key ], $qs_value, $match ) )
    			return true;
    
    		return false;
    	}
    	else{
    		return false;
    	}
    }

    https://www.ads-software.com/plugins/wp-conditional-content/

  • The topic ‘Not Equal Condition’ is closed to new replies.