MariuszEm
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Shortcodes do not work when preg_replace contentMan, you’re life saver;)
Works like a charm now.Forum: Fixing WordPress
In reply to: Shortcodes do not work when preg_replace contentPreg replace, replaces ” a ” to ” a nbsp;”
My shortcode is echoing “test”, but it do not work. WP prints out shortcode tag, as it is, not “test” word.
It is coused by preg-replace, becouse when I change code to simplethe_content();everything works correctly. In place of shortcode i got “test”.Forum: Fixing WordPress
In reply to: WP_query and MySQL lost connectionAnd I got it. ACF makes meta value looks like:
a:3:{i:0;s:10:"value1";i:1;s:11:"value2";i:2;s:15:"value3";
So it is why I can’t use “=” instead of LIKE. It is also why I can’t use IN.IN works like “=”, but it works in array. Is there LIKE for arrays?
Forum: Fixing WordPress
In reply to: WP_query and MySQL lost connectionOne more think about link you posted – codex.
There is line with code below “Display posts that have meta key ‘color’ NOT LIKE value ‘blue’ OR meta key ‘price’ with values BETWEEN 20 and 100:”I use exact code below that text, but I have 3 conditions, not 2. When you put 3rd condition sth goes wrong and SQL query makes it lost connection.
Forum: Fixing WordPress
In reply to: WP_query and MySQL lost connectionNo error, but no results also.
$query_array = array('relation' => 'OR'); array_push($query_array, array( 'key' => 'filter1', 'value' => array('value1', 'value2', 'value3'), 'compare' => 'IN' ) );No results.
$query_array = array('relation' => 'OR'); array_push($query_array, array( 'key' => 'filter1', 'value' => 'value3', 'compare' => 'LIKE' ) );Works like it should (but with one filter), but when I use array(‘value1’, ‘value2’, ‘value3’) i got nothing again.
PS. I am filtering by ACF value.
Forum: Fixing WordPress
In reply to: WP_query and MySQL lost connectionOf course it is not a solution. I was blind not seeing that.
How to make it work?Forum: Fixing WordPress
In reply to: WP_query and MySQL lost connectionDid it.
Just make it:array( 'key' => 'filter1', 'value' => 'value1' OR 'value2' OR 'value3', 'compare' => 'LIKE' )Now I need to put values dynamicly.