hello you can try this
// Add Shortcode
function text_shortcode( $atts , $content = null ) {
// Code
return '<div>' . $content . '</div>';
}
add_shortcode( 'b', 'text_shortcode' );
The shortcode will be something like this
[b] content [/b]
Related Posts:
- Return HTML Template Page with PHP Function
- How do I use Shortcodes inside of HTML tags?
- WordPress Shortcode and Dynamic CSS
- How to create shortcodes that pull custom field data from general settings
- Creating a WordPress shortcode
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- Get list of shortcodes from content
- Audio tags around Mp3 URL in content
- has_shortcode() – how to detect nested shortcode
- How to return multiples lines in a shortcode?
- Wrap each shortcode in array to div
- How do I turn a shortcode into PHP code?
- Put php variable in shortcode
- How to return a foreach inside a shortcode
- Placing raw HTML inside a WordPress shortcode
- Shortcode content output but not in correct place
- PHP code inside shortcodes
- Trigger popup in a php if/else statement
- Append HTML Using Shortcode
- How to output a PHP file values by shortcode?
- How to display posts by current user in a drop down
- Colon is Missing In My Website Url in WordPress
- Pass php dynamic variable to shortcode
- wordpress 4.4 self hosted video (html5) doesn’t show
- do_shortcode with custom field
- Remove echo from shortcode
- Shortcode to show the code
- Get URL from shortcode tag
- Multiple do_shortcode in page template
- get_posts works in the page template but not in a shortcode
- How can I include shortcodes within PHP?
- $wpdb returns duplicate posts
- Syntax error in a shortcode function
- Shortcode to find and replace URL
- Could use some help with Shortcodes
- How to put a form with php code into a variable or shortcode?
- Help with WordPress function inside a shortcode
- Short code template + ajax
- WordPress shortcode returns the data before
- Shortcode to embed Edit Account form not working
- Handling PHP/HTML inside the output of a shortcode function
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Split shortcodes to array of shortcodes
- Shortcodes showing in excerpt despite using strip_shortcodes
- PHP error with a shortcode: “no suitable wrapper” for file_get_contents
- How to make a conditional statement within $output in shortcodes.php?
- Shortcode for a Series of Elevating Image Files, Excluding a Range?
- Shortcode won’t execute
- Shortcode displaying at the top of the page [duplicate]
- AJAX function not working [closed]
- Can ‘Custom Field’ data be inserted into this Short Code?
- MySQL Query Returns Array () In Shortcode
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- How to exclude labels from certain categories in a shortcode?
- Set document title through shortcode plugin
- Trying to call dynamic content into a 3rd party shortcode
- Shortcode in Shortcode/HTML Graphics and Pictures
- Why is the current page loaded in the pop-up window and not the specified one?
- How to search order using database frontend short code WordPress
- How do I reopen the (Popup Maker) after entering the correct password for a password protected page?
- Not able to remove caption shortcode from the content
- How to add a shortcode which runs a .php file for the current post
- Block error message in foreach loop when looping through ACF field
- Get title of page containing post grid within the posts
- PHP multiple forms, same page, isset($_POST[]) not working?
- Shortcodes not processing inside post content
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- wpdb->query returns different value to phpMyAdmin
- shortcodes, custom php and their errors
- I want to hide “sold by” on certain pages with id page 43
- Echo short code syntax
- How to add a PHP scripts into WordPress
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- Multiple Arrays for Custom Post Query using Boostrap accordions and ACF repeater fields
- Replacing entire tag with shortcode – JavaScript [duplicate]
- Offset with ajax load more posts duplicates
- Get posts by id using shortcode
- Shortcode just with a php code
- Shortcode in a $output statement
- Need help with PHP functions
- Custom fields changes the formatting of metabox input
- Shortcode is not outputting all of the desired markup
- Run PHP Results inside WP Shortcode
- Contact form field in wordpress menu
- Serializing URL via wp add_shortcode to auto select from option list onload
- php string inside shortcode does not work
- Limit the number of successful logins
- Shortcodes (with a space) added to php Sample
- Show contact 7 form in popup
- How can I put a custom field as the link of a button shortcode?
- Custom field within shortcode
- Problem using explode inside add_shortcode() callback funciton [closed]
- Php inside the shortcode is getting commented
- Shortcode to include PHP file, pass various parameters to include?
- Display Current Time using shortcode
- Set variable in javascript and using in my shortcode
- How to create shortcode of this PHP code
- why css file not link?how to create permalink?
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- Shortcode Displays 2 times