How to store queried custom data and use it in multiple pages?

<?php
$contact = new WP_Query(array(
‘post_type’ => ‘contact’
// ‘post_status’ => ‘publish’
));
while($contact -> have_posts()){
$contact -> the_post();
$watsapp = get_field(‘watsapp_no’);
$mobile = get_field(‘mobile_no’);
$telephone = get_field(‘telephone_no’);
$address = get_field(‘address’);
}
wp_reset_query();
?>

I need to echo the contact details in multiple pages
Do i need to call it in each page or there is any simple way to not
repeating the same query?

Read more here:: How to store queried custom data and use it in multiple pages?

Leave a Reply

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