Once you retrieved your categories, let’s say in $categories, you can do something like this:
<?php
foreach ($categories as $catgory) {
?>
<form id="cat-button-form-<?php echo $category->ID; ?>" action="<?php echo $url_to_step_2; ?>" method="POST">
<input type="hidden" name="mycat" value="<?php echo $category->ID; ?>" />
<input type="submit" name="getcat" id="getcat_<?php echo $category->ID; ?>" class="btn_catstep" value="<?php printf(__('Select %s & Continue'), $category->name); ?>" />
</form>
<?php
}
?>
In step 2 you then read $_POST['mycat'] and go from there.
Related Posts:
- Saving two categories from two dropdowns in front end posting form
- Category links suddenly started giving 404 errors
- exclude category from WordPress Form function
- How to retain the values from dropdown category lists after wrong form submission?
- Any way to assign Post Categories and Tags to Links?
- Is it possible to select and edit the way the most recent post from a certain category is displayed on the page?
- How to enable category hierarchy for links?
- Combining post categories and link categories?
- Additional form options based on category selected not working
- Displaying a full post instead of a slug per category?
- Link Attachment Image to Category
- Class active for Archive link – looped out
- Why do my categories redirect?
- Get category url in loop
- Older entries link within category page
- Style category link depending on category ID
- Get paged category link programmatically
- Link To Child Category For A Post
- How to not display a category post on blog page?
- Link from navbar to categories
- Search form options group categories
- javascripts files not linking to my category slugs?
- Redirect depending on category chosen
- wp_insert_link not working
- Exclude category from drop down list form
- How to list posts from a sub-category that is listed in a parent category (more details below)?
- Show Subcategory Name Instead of Parent Category
- Link For Portfolio Categories
- Default URL for category dropdown select option
- wp_category_checklist won’t show up for non-admin users
- How to get the link of all categories
- Ajax call activate after submit in edit-tags.php page
- Featured image for links and categories
- Displaying categories and subcategories without link
- How to get category slug link? ( include parent categories)
- WooCommerce: List All Categories
- How can I hide a category from Contributors in the edit/add new post screen?
- Category page doesn’t use category.php, instead it redirects to homepage
- Multiple post categories – single permalink
- Wrap Post count in a span
- Create product category and keyword search form in woocommerce? [closed]
- How would you create a “weekly” archive?
- Exclude most recent posts from specific category in wp_query()
- Display all posts with same title
- Show children of top level category only
- is_archive() content being shown instead of is_category()
- wp_list_categories to show list of categories and the description
- How to display a description of a given category from a custom taxonomy
- Add custom taxonomy under the category title
- How to modify category.php to list posts alphabetically?
- Include template before a loop
- Include posts from feature category in pre_get_posts
- Create blog page only to see one category
- Looking for the best solution to build this Blog structure? Picture attached?
- How Can I Display Categories Description
- Specified number of categoy posts not showing correctly
- Display Slug instead of Name
- Set Current Category to Active in category.php
- Filtering multiple categories via the URL
- How to hide category description in the subpages? [closed]
- WordPress query via checkbox form
- Multiple categories with common subcategories
- Counter in loop in foreach
- How to limit number of attachments
- Show category name and new articles and display page numbers. What function to use
- Add child category to parent on post creation and save
- wp_list_categories in in nav_menu
- Customize category page for different custom taxonomies
- Get posts under a category with SQL
- How to create a custom meta box field in category? [duplicate]
- How to show 1-5 of X Total Results
- Combine “category search order” with “don’t display child posts”
- SQL query to return categories and category parents
- How to Remove a Title from All Category and Tags Page?
- WordPress Show Parent Category Description for Sub-categories
- How to not display subcategories in Recent Posts widget area?
- Getting the Most Recent Posts from Multiple Categories
- Add Date & Author Meta to Category Archive Page
- A dropdown with checklist
- How to store category and tags separatly on wordpress?
- Show Secondary Sidebar on Category pages (archive)
- Get post content intro text on category.php?
- Conditional category query breaking?
- Unable to browser posts in categories
- 3.1 post formats and specific categories/custom taxonomies
- Inline If statement to echo CSS [closed]
- Template category.php with page (no posts)
- How to set featured image as background for a specific category?
- Confused about category.php template – not working
- Adding relevant categories to related post
- How can I add a Categories page link to a menu? [closed]
- Way to show content of a post, but if exceeds character limit revert to excerpt?
- Chained drop-down menu for custom taxonomy using chained.js
- How to display the posts belonging to a paticular category
- WordPress 3.5 how to determine if user is on category listing or category edit screen?
- Javascript code for Category
- Display only one level subcategory in wordpress
- How Do I Add HTML Support to the Additional Category Description Field?
- Can’t filter categories using isotope
- Sorting past events by month