How about jQuery append method?
To make a counter, simply increment i variable every click.
$('body').on('click', '.add-more-button', function() {
var i = 2;
$('.widget-input').append('<label>Link' + i + '</label><input>');
i++;
}
This is just an idea, I guess someone more experienced can develop it further.
Related Posts:
- Widget page is missing from menu and default widgets are not showing
- Creating a simple button inside of a widget
- Hiding the widget meta box in the Appearance->Widget screen
- How to give a File Upload option in wordpress Widget backend?
- Creating an custom admin page for editing widgets
- How to load Widget javascript + css files only if used?
- Adding iframe Content to Sidebar Widget
- Storing custom dashboard widget options in wordpress
- $post>ID displays wrong post ID
- Video Embed in Sidebar Widget with Links to Others in Category
- Shortcode from a widget is wrapped in unwanted element
- How can I whitelist only specific shortcodes for processing in text widgets?
- Bookshelf plugin and/or widget [closed]
- How to update widget from widget() function?
- Manual display of widget
- Add a banner to the Dashboard
- Customized widget area – how to override or filter class xoxo?
- How to access widget data from outside widget?
- Unable to get Alert function to consistently work with backend widget with latest WP
- How to add a description to Widgets?
- Widget options get
- add_page_menu to make shortcut to widgets
- Insert custom content before widget title/after widget opening tag
- Show widget when not using SSL
- How/where is the global variable $wp_registered_widgets filled?
- Converting a WordPress widget to a block
- Color Picker Showing Twice When Widget Added to Sidebar
- How can I use AJAX to save/update a widget form?
- Display assigned terms with link
- Hide all Dashboard Widgets (not remove)
- Widget modifications in a child theme
- How to get “Widget Logic” plugin’s input value in a custom widget code (to display on the Widget admin page)
- Extending WP_Widget throws error when Monster Widget used
- Making footer widgets responsive
- Custom html widget with a Joomla-style assigment
- Form link throwing website to main language
- Conditional Tags Based on Previously Viewed Posts
- Make page jumps in widget
- Query in query for Widget
- How to display first post thumbnail as a background image of a widget?
- Create widget in dashboard displaying a custom user field?
- How to create pagination for homepage with widgetized area?
- Hooking action once but called twice
- How to update the widget form when the image is selected?
- How to overload the update() of existings widgets?
- Help me out with this Undefined index ?
- Displaying a WordPress widget by name
- Remove “Content” and “Discussion” from Right Now Dashboard Widget
- wordpress widgets screen disappeared
- Proper approach to moving complete site from one domain to another AND preserve widgets
- Why custom widget won’t appear in Block editor (Gutenberg)?
- Header Sidebar Won’t Move Lower – Want to Align with Header Logo [closed]
- display widget checkbox selection on frontend
- Enabled checkbox by default in WordPress widgets
- Is there a way to use get_sidebar() when no widgets are activated?
- Is there any tab widget plugin supporting third party widgets? [closed]
- Add footer widgets
- Widgets in WP 4.3 disappearing – How to fix?
- How should I add a “widget” like element?
- modifying title (in dashboard) for different widget instances
- How to translate Widget Description in constructor?
- Custom CSS for a particular text/html widget in WordPress
- Removing side bar widgets from GovPress theme
- Adding a single text input field to a custom Dashboard widget
- how to show only particular category post in archive widgets
- How do I customize the positioning of WordPress widgets?
- Limit archive widget results
- How can I detemine the parameters needed by the_widget()?
- widgets in footer?
- Can you hide a widget based on its content?
- Fatal error: Uncaught Error: Class ‘WP_Widget’ not found
- Array showing all values of loop instead of specific value to post
- Widget not appearing in customizer
- How can I have sidebar widgets on Twenty Seventeen theme on all pages?
- Collapsible widgets [closed]
- Loop through Widgets in sidebar using widget array number?
- Widget settings disappear after refresh
- Loading scripts only if a particular shortcode or widget is present
- Make a widget to my footer
- How to change text of a widget depend on condition?
- Always show the widget title in a wordpress widget
- Custom php Widget keeps disappearing from the front end
- Display Posts by Views (Popular Posts Widget)
- Default WordPress widgets always appear
- Add space to the end on a widget
- Insert to wp_footer if widget is found in the sidebar
- Using javascript on the new widget preview / customizer page
- Show editor widgets only on pages that use a specific template?
- Conditionally enable autoplay when using oEmbed in a custom widget
- Options page for widget
- user definable sidebar per page
- List.js inside WordPress widget
- Show or hide custom menu widget in side bar conditionally
- WordPress Hide Widget If $_Session Is Active?
- Post Thumbnails on Sidebar Widgets
- Using Conditional Tags to restrict something to 1 user?
- Recent posts with different class name for each post and a scrollbar?
- Problem on register/login widgets
- Classic widgets with 5.9+?
- getBlockVariations(…) is undefined in Widget and Template Part editors but not Post Editor