You have been answered in stackoverflow in the following way:
<div id="tab-one" style="display: none">Tab1 info 1 content</div>
<div id="tab-two" style="display: none">Tab1 info 2 content</div>
<div id="tab-three" style="display: none">Tab1 info 3 content</div>
<ul class="side bar tabs">
<li class="one">Tab1 info 1</li>
<li class="two">Tab1 info 2</li>
<li class="three">Tab1 info 3</li>
</ul>
You should run your query in while loop to get the result. define a $i = 1 before loop and increment it before closing while loop like $i++; Now change your html like this:
<div id="tab-<?php echo $i; ?>" style="display: none">code to get tab content</div>
<ul>
<li class="<?php echo $i; ?>">Code to get tab title</li>
</ul>
If you have any confusion. write in comment box.
Related Posts:
- My javascript is returning this error: $.ajax is not a function
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- Infinite scroll / lazy loading with NextGen Gallery [closed]
- Ajax call does not activate callback function
- Trying to get single posts to load on the front page via ajax
- Ajax not firing properly using Firefox, but works in Chrome
- How to Use JSON With AJAX?
- Using wp_ajax and wp_ajax_nopriv hooks
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- WordPress customizer refresh screen after save
- Loading posts via AJAX in a hidden div with updated URL?
- Correct way to write jQuery functions in WordPress
- WooCommerce Ajax Cart Update Stopped Working
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- Trouble with WordPress Ajax Login System – 302
- videopress videos are not displayed when loading the content with ajax in a lightbox
- How to return multiple arguments from AJAX callback function
- url – ajax loaded but no JS
- Ajax Validation for reCaptcha
- Properly embed javascript into WP (using function.php) – doesn’t work?
- Custom AJAX form not working async
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- Is there some jQuery conflict here?
- Ajax page load in wordpress the right way?
- Orderby post__in Not Working Correctly?
- Get ajaxForm response value
- Retrieve customizer value using ajax or customizer api and print the value in theme
- Widget won’t work due to old JavaScript? Any ideas how to make it work? [closed]
- Cross-Origin Read Blocking (CORB)
- Pass request headers in a jQuery AJAX GET call
- jQuery get textarea text
- JavaScript runtime error: ‘$’ is undefined
- JavaScript Loading Screen while page loads
- How to get client’s IP address using JavaScript?
- Simple throttle in JavaScript
- Javascript : array.length returns undefined
- How to manage ajax calls and JSON in wordpress
- How to add a ” waiting” icon for an ajax in WP frontend?
- What is the simplest ajax upload plugin or script to be used with wordpress?
- Add tinymce buttons to caption textarea in media uploader
- RequireJS in custom theme. Working Example
- How to handle multiple instance of “send_to_editor” js function
- call shortcode in javascript
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- wp_enqueuescript won’t load in footer even with true value set?
- jQuery Ajax() doesn’t work when the page is accessed as a WordPress template page
- Execution of JavaScript on save post
- admin-ajax.php HTTP400: BAD REQUEST – The request could not be processed by the server due to invalid syntax
- Is placing stuff in page text edit window bad form?
- Add colorpicker to featured image
- How to speed up admin-ajax.php in wordpress
- wp_verify_nonce not working
- Tags in WordPress 3.2
- php ajax problem – weird 301 responses!
- Not sure why wp_ajax isn’t working?
- Load created php file data via ajax
- Ajax Modal Flickers When Opened Multiple Times
- WordPress Ajax problem with undefined url
- Intergrating agile carousel to wordpress: how to write the ajax_callback function
- Return an array from get_terms and store as JavaScript array for search autocomplete
- WP http XML response HTML encoding and image display problems
- Using WP_Query to grab custom meta values, foreach to json object
- Add/remove action on jQuery toggle
- Javascript stopped working [closed]
- Why load JS through the CMS framework? [duplicate]
- delete post meta by AJAX
- Problem passing id-specific objects to javascript via wp_localize_script
- how to json_encode(); the Loop content so that the encoded array is [“0”:content, “1”:content]
- jQuery tabs plugin with callback to fetch data
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Accessing javascript in multiple files [closed]
- Why i can’t get custom fields value or post ID via Ajax?
- Issues loading Jquery on WordPress website
- No Object Properties sending form through AJAX
- Redirect wp_dropdown_pages() to an AJax request?
- click event to unhide something after ajax not firing
- how to use wp_editor() here am getting empty result
- Accessing an API with jQuery and AJAX
- Parse wordpress blog data using json api and ajax
- Problem adding MP3 attachments to a jPlayer playlist
- problems with jquery external rss feed integration
- AJAX calendar navigation returns -1
- A carousel slideshow plugin in JavaScript
- JS behavior differs depending on page tree [closed]
- How to call a function from functions.php with ajax?
- Ajax post doesnt call succes after got the response
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- Adding scripts before plugins scripts
- jQuery search function not running in WordPress but running locally (fiddle)
- Autocomplete for titles via ajax – rework of past post away from like_escape()
- Clear custom field when new tag is added
- wp_signon not working fine and 302 moved temporarily?
- Are you sure popup on Contact Form 7 [closed]
- how to refresh index page without reloading browser using ajax
- jQuery form plugin, submit in the wordpress way
- javascript not loading in wordpress
- Using WP Ajax and jQuery to process multiple forms on the same page?
- Infinite Scroll applied to ajax loaded content
- How to Javascript/jQuery