I have seen other I have a string ” cccc cccc – fff” I need to return “cccc cccc” I don’t need to delimiter too I tried to echo the result of substr($mystring , 0, strpos($mystring , “-“)); but it return nothing I also tried resulted returned the main string and…
Tag: wordpress
CSS background images in WordPress
Is it possible to get a background image in CSS like you normally do in HTML when working with WordPress. I’ve tried doing this but it doesn’t work. Answer PHP code cannot run in .css file, however you can use inline style, such as: or The above would be useful when working with custom fields for …
WordPress enqueue scripts not adding scripts
I’m trying to load a script into a WordPerss page, however it seems the enqueue script does not add anything. I’m using the following script function loadCC(){ wp_enqueue_script(‘cookieConsentJS’…
Get all Orders IDs from a product ID in Woocommerce
How can I get an array with Order IDs by Product ID? I mean receive all orders where specific product is presented. I know how to do this by MySQL, but is there a way to do this by WP_Query function? Answer Updates: 2017 – SQL query changed to “SELECT DISTINCT” instead of “SELECT”…
How to call ajax in wordpress
My ajax call output is always showing 0 as output don’t know why In functions.php I have this code function get_data() { $abc = ‘1’; $result = $wpdb->get_results(“SELECT * FROM “.$wpdb-&…
Remove WooCommerce checkout fields values
I’m trying to apply autocomplete=”off” on my WooCommerce checkout fields but it just doesn’t work. Is there a way to do that for the checkout form? I checked the docs and there’s nothing available …
WordPress Theme: Standalone theme need index.php file ERROR
I suddenly got got an error when coding – wordpress -> theme: I don’t understand why this is the case as I have an index.php page. Also the css stylesheet is there as well. style.css also has the following commented style.css Here is the folder structure New to wordpress. So confused as to why …
Prevent new WordPress users from logging in until manually “activated”?
I’m developing a plugin for WordPress which has 3 groups of users. I need to disable some users and prevent them from login. what I mean isn’t preventing them to access the backend. I want to …
How to insert Google Merchant Review JS code in WooCommerce Order Complete page
I want to complete the variables the Google Merchant Review codes asks to be completed on the checkout page: &…
Pre-filing checkout post code with a custom value
I have been using this custom function below in the previous versions of WooCommerce in order to pre-fill the City and ZIP code fields: It has been working great until the new WC updates. The city still works, but the default ZIP code field doesn’t seem to work anymore. It doesn’t automatically pr…