Must Use Plugin Causing Query Error

As Milo ( and your errors ) point out: you’re passing an array where a string is expected. According to WP_Query tag parameter Show posts associated with certain tags. tag (string) – use tag slug. To get around this you just need to pass a comma separated string: function custom_tags( $query ) { $query->set( ‘tag’, … Read more

WooCommerce: Add Payment Gateway Field to Webhooks [closed]

Thanks, will do next time. I figured this one out: function my_custom_wc_api_order_response( $order_data, $order, $fields ) { $customer_info = get_post_meta( $order->id, ‘_customer_info’, true ); $order_data[‘payment_details’][‘customer_info’] = $customer_info; // Apply filters if necessary if ( $fields ) { $order_data = WC()->api->WC_API_Customers->filter_response_fields( $order_data, $order, $fields ); } return $order_data; } add_filter( ‘woocommerce_api_order_response’, ‘my_custom_wc_api_order_response’, 10, 3 );

How to run PHP code in Text Widget with no plugin in WP 4.4

Better to write your own widget that does precisely what you need instead of something like this. However, if you really want to execute arbitrary PHP in a widget, use a plugin specifically designed for that task: https://wordpress.org/plugins/php-code-widget/ I maintain this plugin specifically so that people don’t resort to doing things like what you have … Read more

I can’t get my custom widget area to show on my WordPress site

Your have created three sidebars and that are primary_widget_area, secondary_widget_area, footer_widget_area But in the sidebar, you call a different sidebar name sidebar-3; that’s why your sidebars are not displaying. Try the following code in sidebar.php: // To display primary_widget_area sidebar <?php if ( is_active_sidebar( ‘primary_widget_area’ ) ) : ?> <?php dynamic_sidebar( ‘primary_widget_area’ ); ?> <?php … Read more

WordPress File handle – fopen, fwrite not working with $.ajax or $.post Jquery

I guess the issue with this line: $path = “wp-content/themes/creation/templates/inc/log.txt”; You need to use the full path, not a relative part, while using fopen() or file_exists(). Something like this should fix your issue: $path = get_template_directory() . “/templates/inc/log.txt”; get_template_directory() will return the absolute server path, without a trailing slash.