Codex documentation for shortcodes has a section on Handling Attributes.
In a nutshell attributes will get passed on to your callback and you need to implement handling them with your code within it:
function my_shortcode_handler( $atts, $content = null ) {
$a = shortcode_atts( array(
'attr_1' => 'attribute 1 default',
'attr_2' => 'attribute 2 default',
// ...etc
), $atts );
}
Related Posts:
- Split Content and Gallery
- How to return loop contents
- How do I get the attributes of a short code from a post?
- Return vs Echo Shortcode
- as a shortcode within the loop?
- Adding shortcode closing tag after a loop
- What are the disadvantages of using global variable?
- Displaying terms based on loop posts?
- Missing image in gallery shortcode in custom feed
- Shortcode with a foreach and arguments
- Output loop leveraged shortcode twice on one page
- Custom Loop Using Shortcode in Custom Page Template
- Shortcode in posts called by ajax is not working
- Trying to get property of non-object in shortocde
- WordPress shortcode in content, output in sidebar?
- Query posts only with actual text content (not including shortcode or images)
- How to put a block of code between [shortcode][/shortcode] in do_shortcode()?
- How can I pass additional params to a shortcode while in a loop?
- Get a Post Loop based on Logged in User information into a Shortcode
- How to add pagination in Terms
- Split Content and Gallery
- Have multiple loops on a page appear after/between page content
- Using shortcode within shortcode with dynamic variable
- How wp maps urls into files
- How to get Author ID outside the loop
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- How do I prevent one of two multiple loops from repeating on a second page?
- What exactly defines a Main Loop and a Secondary Loop?
- Loop code is displaying pages but not actual posts
- How are both HTTP and HTTPS versions displaying?
- Ajax loop refresh on click
- How do you split multiple-column loop on category archive page?
- How to Loop within a Loop (Display Children and then Grandchildren)
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Is get_posts() more efficient than The Loop?
- loop through all posts memory error
- Get titles of all posts with current tags except current post
- Creating a multi-taxonomy query, excluding the newest (read: highest ID) taxonomy term
- Show a different post every 3 days [duplicate]
- Targeting a Certain Post in Loop (CSS)
- Display most viewed post from last 30 days is not working correctly
- What is the maximum number of posts a WordPress loop can work with?
- Split loop to load WordPress gallery into Bootstrap modal and carousel
- Orderby is working with one query but not with other
- Trouble Formatting DateTime
- Order archive results by post id in custom taxonomy template
- pre_get_posts for two loops on same page
- WordPress Rewriting the DOM?
- Modified loop-single-forum.php to work inside of a sidebar Widget, not working on some site pages
- Basic multiple loops only displaying first loop
- Problem with displaying HTML content after in_array [closed]
- Both a page loop and posts loop on the same page
- WordPress Blog has an infinite redirect loop
- Stepping through a foreach loop – adding +1 to the end of it so next time it loops it starts on item 2
- ACF – add a group inside a repeater [closed]
- How to create bootstrap grid loop?
- get_post_meta is not working inside shortcode
- Is it possible to reverse the order of a list of posts pulled from a loop?
- Get post offset/posts page offset in single post page (outside the loop)
- First article : single column; Other articles : 2 columns
- How can I access specific posts brought back by query_posts?
- Put multiple custom loops on same page
- Contact information footer
- Multisite foreach loop returning only one result
- Loop is crazy – one row displays wrong count of posts [closed]
- Generating a perfect loop
- I need to display all post in onepage
- WordPress loop not working only on home page, works on all other pages
- Adding a featured image to a foreach WordPress loop
- Hook to main query with filters based on custom fields
- Using has_tag() outside loop
- How to create multiple loop in archive page?
- Offset for Loop
- How can I change how my tag pages display?
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- Loop keeps showing the same post even when I click on a different one
- Query users and count totals based on meta values
- php loop error for count posts in category
- display post pdf attachments in side bar with link text
- Display all the terms within a custom taxonomy
- Submit form for loop of products of the term with AJAX
- Use the loop to check if DB record exists?
- Deeply Nested Menu Loop with Twig using Timber [closed]
- WordPress redundant posts based on meta field
- Get featured image outside the loop using foreach
- Infinite Loop after Genesis Theme Upgrade
- pre_get_posts main_query not displaying after applying tax_query filters
- WordPress loop only displays 5 articles max?
- setup_postdata in “loop-handling” php file called via $.ajax
- Secondary loop cuts off at 10 posts?
- get all page templates
- Paged homepage – requirements?
- strange parse error when including a loop template within another template
- Previous Posts Link and Next Posts Link Show All The Same Articles?
- Posts Loops To Display Specific Posts Inside Page Template?
- Use callback function in AJAX pure javascript [closed]
- Undefined variable: woocommerce_loop [closed]
- title not being printed within html tag [closed]
- Use Base-URL with Query-Loop