there isn’t an “space” in the Shortcode-Name. What you have, is an shortcode called “customcont”, that is providing an Parameter called “form”.
So this is, how it should work:
function example_shortcode( $atts = array(), $content="" )
{
extract(
shortcode_atts(
array (
'form' => 0,
),
$atts
)
);
return 'FORM TO DISPLAY IS #'.$form;
}
add_shortcode( 'customcont', 'example_shortcode' );
With the $form
Variable you can Access the Number of the form to Display, in your case the “3”.
Related Posts:
- How to manually fix the WordPress gallery code using PHP in functions.php?
- Encode text string being appended as query to URL [closed]
- Any guides on creating custom admin pages?
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Display a text message if the shortcode is not found?
- How to return a string that has a variable inside in a shortcode?
- Run shortcode at certain resolution
- Passing a shortcode attribute to a sub-function
- How to create shortcodes that pull custom field data from general settings
- post meta value as shortcode parameter
- How to protect own PHP code from WordPress updates
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- Adding Field to Profile “Name”
- Loading page template into shortcode
- How to add Shortcode (font awesome) in widget title?
- Placing the_content inside shortcode not working
- Autogenerate shortcodes from an array of strings
- How to Insert Shortcodes into Theme?
- Template part inside shortcode, unexpected reult
- Shortcode Inside Class Not Working
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- Admin Options page. Save as Array
- Shortcode API: How to get name that matched shortcode RegEx?
- Custom Theme, Custom shortcode not working
- Why is file_get_contents returning page source?
- Plugin CSS not enqueing
- Different loop output every x posts in custom post type
- Showing content from one page on another
- Correct folder permissions?
- Showing a different gallery in a seperate post
- Create own WordPress shortcode gallery
- Get value from shortcode to do something
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- How to use wp_add_inline_style for custom CSS added via shortcode?
- Displaying recent posts on static page with template-part via shortcode
- Shortcode returns values in the wrong order
- Building a WordPress App
- Embedding PHP in shortcode $content
- Excecuting php function in shortcode
- Returning data instead of echoing/printing
- List taxonomy term slugs within shortcode (do_shortcode)
- ::before on open/close function [closed]
- Is There A Way To Make Theme Files Accept Shortcodes?
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- Using Shortcode to Grab Archive Listing, Separate by Year
- retain querystring values when savincustom options in admin
- Unable to process php via shortcode
- List all blogs, but exclude the main site
- Cant display an image via PHP in wordpress
- Shortcode to pull posts
- PHP code inside Shortcode
- Help Fallback (thumbnail)
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- Action Hook Inside WordPress Plugin Shortcode
- How can I include the user id inside of a shortcode php output?
- PHP Helper Class to create shortcodes
- help with custom shortcode that stopped working
- Change Spaces to Dashes?
- Adding a ‘style=’ bit to image_send_to_editor output
- Updating Metadata with Shortcode
- using shortcodes inside gravity forms
- How to Create custom block for displaying information in content section which act like shortcode
- Create shortcode for metabox gallery
- couldnt show short code atts in category
- How can I edit the final HTML structure of the whole web page
- I am having an issue with this shortcode plugin.. Warning: Illegal string offset ‘title’
- Advanced Custom Forms PHP formatting for do_shortcode
- overwrite wordpress gallery with custom gallery shortcode
- How to use Contact Form 7 shortcode value in a page?
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Editing the term_order field
- Show products per shortcode
- Open/closed function [closed]
- What is wrong with this shortcode? to include external php file in WordPress posts
- Need to Echo A Url path to show on a wordpress page
- Force ‘permanent’ post cache of shortcode results
- Wrapping shortcode content in a span or link
- wordpress ajax return 0
- Formatting Shortcode to Display in Visual Mode
- Use html tags in shortcode_atts, is it real?
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- How to have Function of a plugin using global vars into a shortcode?
- Overwriting a Shortcode
- How can I put a custom field as the link of a button shortcode?
- Where to place PHP for shortcodes
- How to wrap a text with shortcode into php file?
- PHP Widget and do_shortcode
- Problem using explode inside add_shortcode() callback funciton [closed]
- Shortcode not passing variable to included file
- Forbid certain users to access a specific page
- A next page function with shortcode?
- using a shortcode in a hyperlink
- Display Current Time using shortcode
- WP Custom tables query
- Display total count of products in orders of a specific order status
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- HTTP 500 Error after Creating Shortcode
- How call WordPress shortcode inside function file
- How to execute a shortcode within a custom field?