wp query template tags not working

i create a page : contact-us then i specify a template for this page , and this is the template code:

‘post_per_page’ => -1 ,


$test = new WP_Query($arg);

if ($test->have_posts()) {
while ($test-> have_posts()) : $test-> the_post();

echo $test->get_the_title();
echo $test->get_the_content;


the result page is blanck even if the var_dump($test) return the list of post with the information. for your information i tried query_post() and it works fine.
please help me.

Read more here:: wp query template tags not working

Leave a Reply

Your email address will not be published. Required fields are marked *