Exclude image url from search query

try this to exclude images from search. Add code to your functions.php: // Exclude images from search results – WordPress add_action( ‘init’, ‘exclude_images_from_search_results’ ); function exclude_images_from_search_results() { global $wp_post_types; $wp_post_types[‘attachment’]->exclude_from_search = true; }

Wrapping add_query_arg with esc_url not working

And the strange part: both codes echo the same string for $url!!! No, they don’t. Look at the page source. esc_url() is encoding the & control character. You can’t do that and expect the HTTP request to work correctly. Use esc_url_raw() instead. Note the description in the Codex concerning that function: The esc_url_raw() function is … Read more

How to rewrite URL and get the values?

The simplest and quickest solution would be to use the add_rewrite_endpoint function. <?php add_rewrite_endpoint( $name, $places ); ?> So in your case it would be something like this: add_rewrite_endpoint( ‘user’, EP_PERMALINK | EP_PAGES ); An user URL would look like this: http://www.example.com/my-page/user/john To access the variable: $user = get_query_var( ‘user’, false );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)