Well, i'm creating a wordpress theme, but i can't get wordpress loop to work correctly for some reason. This code works fine in index.php :
<?php if (have_posts()) : while (have_posts()) : the_post(); var_dump($post); endwhile; endif; ?>
But, it does not work in my blog.php page(it's not a template, it's actually a shortcode). The shortcode works correctly for sure. But when the above code is executed it just prints NULL. If i try to grab the_content, the page loops indefinitely.
Any idea why this can be happening ?