fetch meta fields inside a widget
I fixed this by adding: global $post; More specific: I can’t explain why this works, that’s beyond my WordPress skills, but I added it right after the start of the query, so the code looks like this: <?php global $post; $loop = new WP_Query( array( ‘post_type’ => ‘kurs’, ‘posts_per_page’ => ‘5’, ‘meta_key’ => ‘dato’, ‘meta_value’ … Read more