Limiting WordPress Search function : Custom build

This code will only search form woocommerce products. If you want to show any other search result from another post type you can do by simply change post type slug ‘product’ with you own post type slug add_action( ‘pre_get_posts’, ‘wpse223576_search_woocommerce_only’ ); function wpse223576_search_woocommerce_only( $query ) { if( ! is_admin() && is_search() && $query->is_main_query() ) { … Read more

How to limit the number of custom posts certain users can publish in WordPress using php script?

Welcome to StackExchange! I made some changes to your code that I pointed out with comments. I’m not sure if this will actually work so you have to try it, and probably your way of echoing the message won’t work because after updating there’s a redirect so you’ll have to work with the admin_notices action … Read more

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