Creating an WordPress website and you want to push the PHP data to the external JS script! But how you gonna do that? Learn it here! It’s very simple!
PHP data to the external JS file There is an simple answer! Use the wp_localize_script() function from WordPress!
I assume that you’re familiar with the right way to load the JS or jQuery scripts with wp_enqeue_script() function. Only than you can use wp_localize_script().
If you searching for an possible solution for your problem with Custom post types and Pagination. Maybe this snippet could help you.
I’ll find out the the WP_Query() function does not work if you want to make an archive page with multiple custom post type’s. After searching for some ours, i find the solution. You should use the function query_posts() to get pagination.
** Copy the function in your functions.