Tag Info

New answers tagged

0

Managed to work it out, the problem was down to how I had set up my home page to display only my custom posts. I had set a static home page in Settings > Reading and I was using the following new WP_Query in front-page.php to show all my CPT 'portfolio' posts. <?php $args = array( 'post_type' => array('portfolio'), 'posts_per_page' => ...


0

If you follow the second approach in the linked Q\A, you do not need ajax, but just to pass the array of terms to the script. First of all in your functions.php (or equivalent) enqueue the script and pass the array of trades via wp_localize_script: add_action( 'wp_enqueue_scripts', function() { /* you should check if the page is the one that include the ...


0

You don't need to do this part $tradesList = '["' . implode( '","', $trades ) . '"]'; json_encode converts array to json. EDIT: php code function get_my_suggestions() { // This function should query the database and get results as an array of rows: // GET the recieved data: 'term' (what has been typed by the user) $term = $_GET['term']; $trades = ...



Top 50 recent answers are included