A couple of things before I get into the code:
1) It would probably be a cleaner solution to solve this in the theme via extended functionality (PHP modifications) as you gain more experience with WordPress.
2) If you are able to use numbers (1,2,3) instead of words (one,two,three) you can clean up the javascript solution even further.
On with the code!
See the fiddle for a working example: https://jsfiddle.net/2nzcnhwL/
// run after load to be safe
$(document).ready(function () {
// map our numbers to words
var subTabGroups = ['one','two','three','four','five'];
// loop through all of the panes
$('.mk-tabs-pane').each(function (i) {
// append each group of subtabs to the corresponding pane
$(this).append($('.tab' + subTabGroups[i] + 'content'));
});
});
Related Posts:
- Switch to the library tab in the media uploader
- Google Map iframe in a tab issue
- Access jQuery tabs from primary menu while adding/removing class on tab container elements (accessing diff. tabs/tab content via primary menu items)
- How to delete a cookie?
- ES6 Map in Typescript
- How do I color a hexagonal grid such that it doesn’t have neighbors of the same color?
- How to format a JavaScript date
- Wait 5 seconds before executing next line
- How to check whether a string contains a substring in JavaScript?
- Maximum call stack size exceeded error
- How to set header and options in axios?
- JavaScript equivalent to printf/String.Format
- How to read a local text file?
- Open a URL in a new tab (and not a new window)
- Node.js heap out of memory
- JavaScript getElementByName doesn’t work
- jQuery.click() vs onClick
- Understanding nested for loops in javascript
- JavaScript: Upload file
- Console logging for react?
- What is the “right” JSON date format?
- Node.js – SyntaxError: Unexpected token import
- What is the “right” JSON date format?
- jQuery animate backgroundColor
- JavaScript get element by name
- How do I disable right click on my web page?
- Left() function in Javascript or jQuery
- Why is “forEach not a function” for this object?
- Completely disable scrolling of webpage
- Blocked script execution in because the document’s frame is sandboxed – Angular application
- Node update a specific package
- How to fix RichEmbed Discord.js
- How to convert selected HTML to Json?
- Express error – TypeError: Router.use() requires middleware function but got a Object
- How to Open New window on every Click
- Jquery Ajax Call, doesn’t call Success or Error
- How to create a stopwatch using JavaScript?
- Why does JSHint throw a warning if I am using const?
- Uncaught TypeError: .indexOf is not a function
- Get all non-unique values (i.e.: duplicate/more than one occurrence) in an array
- How to set onClick with JavaScript?
- How does += (plus equal) work?
- Javascript Comparison Operators != vs !==
- onEnter not called in React-Router
- Find the largest palindrome made from the product of two 3-digit numbers – Javascript
- Javascript/Jquery Convert string to array
- How to interpolate variables in strings in JavaScript, without concatenation?
- How can I use webpack with express?
- JavaScript check if variable exists (is defined/initialized)
- Embedding instagram webpage inside an iframe
- Do something if screen width is less than 960 px
- How to add a keyboard listener to my onClick handler?
- Javascript: ‘window’ is not defined
- Javascript – Replace html using innerHTML
- Syntax error: Illegal return statement in JavaScript
- Error: TypeError: $(…).dialog is not a function
- Bootstrap modal – close modal when “call to action” button is clicked
- Javascript: difference between a statement and an expression?
- Keep getting a “Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup” when attempting to google plus login on my web app
- Reading local text file into a JavaScript array
- “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied”
- How can I unset a JavaScript variable?
- D3.js: what is ‘g’ in .append(“g”) D3.js code?
- Correct modification of state arrays in React.js
- Angular 2 Sort table columns
- JavaScript string encryption and decryption?
- How to dequeue a script?
- How to use wp_localize_script in custom page template?
- Combine enqueue js without affecting dependencies
- Force core to use .dev JavaScript files
- WP Customizer set a value via javascript (to create presets)
- preserve url parameters from affliliate sites
- How to overwrite JS variable with wp_localize _script?
- Add javascript to a woocommerce page template
- How to get value of selected page template in Gutenberg editor?
- What javascript libs & frameworks are integrated in WordPress vanilla?
- Conditional fields in contact form 7 not working
- How to place script in footer?
- Enqueueing a script and a style sheet not working
- AngularJS with route and JSON API
- Uppload image from another source wp.media
- Use onfocus event in Contact Form 7
- Get Block Attributes in JSON REST API
- How to open the add media dialogue it in a certain state / tab?
- enqueue script won’t work (enqueue style does work)
- Variable equals another variable and then equals another variable
- in jquery read a multidimensional array via wp_localize_script()
- How to stop javascript code being broken when going into visual editor
- Add JavaScript to single post
- Failing to load my script files in wordpress! i can’t figure out what i’m doing wrong
- WordPress getting css and script files from client machine rather than the server machine
- Facebook fanbox problem
- How to load Javascript code or functions.php later in a child theme?
- wp-api Backbone JS Client fetch options
- Deferring Script wp-i18n causes a console error ‘wp is not defined’ – Gravityforms
- Get user in rest API endpoint
- Dynamically write in editor with Javascript
- How to change number field to text field using JS
- Uncaught SyntaxError: missing ) after argument list [duplicate]
- Styling parent based on a child element of a child in a WordPress page