Edit your function to accept a parameter, e.g. function modell_nach_personenzahl( $value ) {
Edit your meta query to accept this parameter, e.g. 'value' => $value
Then register a bunch of shortcodes:
for ( $i = 1; $i <= 7; $i++ ) {
add_shortcode( "shortcode-name-{$i}", function() use ( $i ) {
modell_nach_personenzahl( $i );
} );
}
Then just use [shortcode-name-1]
, [shortcode-name-2]
, etc.
Related Posts:
- Problem with extract() with custom shortcode
- Pass Shortcode Attribute to footer Script
- Use a shortcode to display custom meta box contents
- Wp-query Order By problem
- Shortcode to insert default text and change one word throughout it?
- How To Show Shortcodes In WordPress Custom Fields?
- Shortcode to eliminate and replace with
- restrict access to specific urls on a specific period of time
- Excerpts are not displayed by a shortcode on category pages
- Redirect to another page using contact form 7? [closed]
- WordPress Shortcode function display outside of widget
- check if the user is owner of current page
- shortcode help require
- Optimizing a WordPress site
- different style sheet for just one page template
- Help With Creating Shortcode
- Use html inside shortcode function
- Condition OR for current user ID
- How to retrieve the current post’s generated featured image size?
- Shotcode argument issues
- Shortcode parse error – wrong syntax
- Exclude category from shortcode
- wp_nonce_field is breaking form for reasons unknown
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Where do I store custom functions that call custom page template files?
- get_pages() Returns Only One Item
- Why There Is No “get content by ID” Function
- Function shortcode – Set Parameter
- Adding an option to a shortcode
- Custom HTML markup
- How to use author meta in shortcode?
- Using multiple line variable inside a function?
- Testing for a shortcode using a function. 404 page throwing PHP Notice
- Echoing function into WordPress NextGen gallery
- Output loop to function return?
- How to echo the value of an array element using a function via a shortcode
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- How to parse a shortcode within a shortcode?
- Variables not showing in short code
- login_headertitle is deprecated since version 5.2.0
- How to append classname to body tag if guest user
- Woocommerce checkout field
- Where do I go to edit this area? [closed]
- How to include any template using Shortcode fuction?
- Replace plugin function with a custom function?
- How can I pass a shortcode value to the head in wordpress functions.php
- Add attribute only to first image of every post via functions.php
- Native gallery custom html output
- Different favicon on different pages
- Need to convert image url to a Base_64 data url with wordpress function..
- The_content and Preg_replace in loaded Iframe [closed]
- dynamic site link for future migration in echo do_shortcode()
- How to create shortcode with html and php content?
- Tracking the number of shortcodes for a list?
- Need a method to prevent WP from adding in between my shortcodes
- Load scripts for do_shortcode( ‘ [ my_shortcode ] ‘ )
- Shortcode question
- Can I include a custom PHP function in a WordPress function?
- How to create a shortcode out of a php function
- Problem with images URL after filter applying
- two search forms on the same page
- Function to replace comment’s accented characters before posting
- Shortcode to get featured image of specific id post
- Modify shortcode to work with custom post types
- shorthand syntax for custom fields
- Insert a field with PREG_REPLACE – strange behaviour
- How to echo Widget Title in Custom Frontend-Template Box
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- how to display a page before the home page
- loginout function customization
- Shortcode of a function
- Function to check if custom page is used by page?
- show all the posts thumbnails
- implementing a centralized content “show-do-not-show” toggle?
- How to add a shortcode to call a function
- How can I call a PHP function inside a hardcoded shortcode?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Problem with shortcode inside a shortcode
- Need help making a short code work
- Using One Function To Create Two Different Shortcodes
- Is it possible to create a shortcode to link to a specific post/page where the tag is just an attribute?
- How to remove font awesome from loading in wp theme
- Display a list of random terms from custom taxonomy with shortcode
- Load templates, pass arguments, and render output from functions.php
- How do I make the comment disappear after deleting from the database?
- How to add if statement on WordPress shortcode output
- Passing function arguments via a shortcode
- Pagination not working – FrontPage
- Customizing the wp_video_shortcode output with add_filter
- How to replace ACTION url from original wordpress login form?
- Header menu aligned right on all pages except for single-post page [closed]
- page shows short code not output
- Probleme shortcode with list author
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?