my function doesn’t return my post from today
my function doesn’t return my post from today
my function doesn’t return my post from today
Setting Up PHPUnit tests for WP development on Windows
Get widget settings function?
It is quite hard to properly answer your question with the amount of context in your question, but I am going to try to use the context from your previous question Having a bit more context here on template, and if I read this correctly, this is on your index.php, I still believe and stand … Read more
You can use WP_Query to get almost any post data out of your WordPress install. $sub_pages = new WP_Query( array( ‘post_parent’ => 3, ‘post_type’ => ‘page’ ) ); print_r($sub_pages->posts); This would get you the following: Array ( [0] => WP_Post Object ( [ID] => 94 [post_author] => 1 [post_date] => 2015-08-20 11:19:27 [post_date_gmt] => 2015-08-20 … Read more
Create a must-use plugin. Put it in <docroot>/wp-content/mu-plugins/selective-posts.php Following should be the code in selective-posts.php to filter specific posts. function golfclubs_tag( $query ) { if ( $_SERVER[‘HTTP_HOST’] === ‘www.golfclubreviewdomain.com’ ) { $query->set( ‘tag’, ‘golfclubs’ ); } } add_action( ‘pre_get_posts’, ‘golfclubs_tag’ ); This way it would filter all the queries across the site for specific domain … Read more
The WordPress codex mentions you should call the Widget Class name. Could it be that openingTimesWidget is a function instead of a Class? Following the WP Class naming convention your class would be written like this Opening_Times_Widget. https://codex.wordpress.org/Widgets_API Another possible reason that the widget is not displaying could have to do with the way your … Read more
What is the content contained within your add-to-cart.php file template override? It should be similar to this: global $product; echo apply_filters( ‘woocommerce_loop_add_to_cart_link’, sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/218348/%s” rel=”nofollow” data-product_id=”https://wordpress.stackexchange.com/questions/218348/%s” data-product_sku=”https://wordpress.stackexchange.com/questions/218348/%s” data-quantity=”https://wordpress.stackexchange.com/questions/218348/%s” class=”button %s product_type_%s”>%s</a>’, esc_url( $product->add_to_cart_url() ), esc_attr( $product->id ), esc_attr( $product->get_sku() ), esc_attr( isset( $quantity ) ? $quantity : 1 ), $product->is_purchasable() && $product->is_in_stock() ? ‘add_to_cart_button’ … Read more
The use of header() function produce output in the middle of the request and crash it. To modify uploaded image you should use wp_handle_upload filter instead of save_post action. Also, ideally, you should use WP_Image_Editor class, which will use the best image manipulation library available in the server (GD, Imagemagick) and triggers several filters and … Read more
When using ACF you should use the methods described in their website documentation because ACF does not store data in the normal WordPress way. You can use the get_field or the_field functions to retrieve data from your fields. For example to get data for your field ‘cover_photo’ you could do: $user_id = get_query_var( ‘author’ ) … Read more