If the page & content is short enough & you don’t mind some extra initial loading time, you can load all the content tabs on the page at the first time & then just use javascript to show/hide different tabs
// the loop to list the titles here
$wp_query->rewind_posts(); // reset the loop
while ($my_query -> have_posts()) :
$my_query->the_post();
?>
<div id="<?php the_ID();?>" class="the-content">
<?php the_content();?>
</div>
<?php
endwhile;
If you strictly want ajax, see this http://codex.wordpress.org/AJAX_in_Plugins
You’ll need to pass the id of the post as a parameter in ajax request & then use this parameter in your code to determine which post’s content is to be returned
Related Posts:
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- Retrieve POST data from AJAX call
- WordPress Ajax always returns a 404 error
- problem with ajax and the path to the php page
- How to use wp_localize_script in a WordPress page other than functions.php?
- Real time Duplicate title check
- Load custom field value into div with AJAX
- Jquery ajax to custom php file: returning blank data
- Update WordPress Custom Field with AJAX on cached page
- Targeting single page with JS
- Can’t use get_results() in ajax query
- Click loads template via ajax
- Display notification only once
- ajax_object is not defined when ajax calls the function
- Returning a value from a PHP page
- Why is this Ajax not working?
- Stumped – Ajax Response Returns 0
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- Sending jsPDF documents to the server
- Ajax return code 400
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- doing an ajax request always outputs 0
- Woocommerce add to cart quantity buttons with AJAX
- class click counter save number
- Checking for new message using AJAX and PHP. Server overload?
- AJAX request status 200 but no actual “response”
- wordpress count link clicks by ip address
- Ajax load more posts with multiple tax query
- WordPress Sending data to Ajax with select option
- WordPress ajax doesn’t display object method on jQuery .change() function
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- Save Search System
- populate form fields in a loop with ajax
- dynamic dependent select dropdown
- Change “add to cart” button color based on Woocommerce product category [closed]
- Ajax request returns ‘Array’. How to output the actual results?
- Show success or error messages in Ajax response to WordPress custom registration form
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Plugins not working on AJAX requests
- Fancybox type popup window that’s not an iframe
- How to disable controls in theme customizer?
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- How do I Import / Upload Files with jQuery AJAX?
- WordPress Ajax Call inserting data but success response false
- Pull GetOption() variable into jQuery dynamically created html
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- Function won’t run onclick using Ajax
- WordPress plugin admin page – using WordPress function in linked php file
- A $_POST should occur when submit form but is not?
- jQuery Ajax PHP function call returning [object Object]
- Shortcode to pull posts
- Ajax search shows all results when user empties input?
- Why i can’t get custom fields value or post ID via Ajax?
- Get uploaded image and attach it to the new post
- Admin-ajax php not working on new wordpress version
- Add a counter for mouseovers (custom field)
- Accessing an API with jQuery and AJAX
- Execute Jquery when a specific page in my plugin is loading
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- How to load previous or next attachment with jquery ?
- How to set variables with AJAX request to use in another function in WordPress
- Validating an email input from form field before submit using JQuery, AJAX, and PHP
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) through wp_admin_ajax.php
- Ajax result show in console if is called outside function and not showing in array
- Ajax filter with loadmore button
- Admin-ajax.php 404 error
- How to pass values from one function to the other using an array variable
- How to change PHP variables with AJAX request in WordPress
- Update $wpdb query with AJAX
- wp_ajax_ 400 Bad Request
- AJAX to add to cart multiple products woocommerce
- update_post_meta Not Processing Array Data (Not Sure What I Am Missing)
- WordPress ajax filter returning all posts when it should be filtering by category
- Input field duplicates on form submit by jQuery
- How to echo a PHP code into WooCommerce variation product?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- How to call a function from functions.php with ajax?
- Remove item from post_meta array via AJAX
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Find the method which AJAX GET calls
- AJAX Filter WHILE Loop not working WordPress
- wordpress ajax pagination
- WordPress AJAX load post metadata in modal
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- ajax form with multiple submit buttons and values
- How to run ajax in WordPress Post?
- 500 (Internal Server Error) of external php file
- Use jQuery and AJAX to get HTML
- Adding instant search to wordpress page
- Add php function into .js file (for tinyMCE button)
- AJAX: WordPress filters inside $html do not work as intended
- Why not showing all post by default in my jquery filter
- Jquery autosave text area after typing
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- notify users when changed database
- getJSON response to PHP
- ajax problems on loading page [closed]
- Upload multiple files via ajax from an HTML file input
- custom AJAX filtering logic and outputting results into an Elementor Loop Grid widget