First create the meta box with a simple input value to insert the text you want. Here is a good example.
Then you take the input from the meta box and create a function to store it as a shortcode. Check out the Shortcode API to enable the shortcode. Something like this should do the trick:
function new_title( $atts ) {
if (!isset ($_POST['your_meta_input'])) {
return;
}
else {
return $_POST['your_meta_input'];
}
}
add_shortcode( 'city', 'new_title');
Related Posts:
- How to add a shortcode button to the TinyMCE editor?
- How to include code only on specific pages?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- PHP Deprecated: Non-static method should not be called statically
- Loading shortcode with ajax
- Cannot strip JW Player shortcode?
- How to pass multiple values in shortcode?
- append stylesheet via shortcode
- Calling function from within functions.php returns unwanted value
- plugin shortcodes not working on custom theme- unsure how to fix
- How to list all active and specific shortcodes in wordpress
- Nested shortcodes
- do_shortcode() doesn’t work if shortcode contained in variable, works if shortcode passed as string
- wp_specialchars and wp_specialchars_decode in a shortcode plugin
- Plugin shortcode won’t work on a custom template file [closed]
- shortcodes displaying outside of content area with echo statement, not what I wanted [duplicate]
- Trying to count the total number of paragraphs inside a blog article
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Adding json as params to shortcode
- Shortcode is not working in homepage page template (custom front page)
- May i Use ShortCode in Template?
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- How can I create a custom shortcode that will return a custom post type by ID?
- AddToAny shortcode in the loop
- How to add an automatic refresh in WordPress for a Page/Post or an embedded OneDrive/Excel HTML Code?
- Making a Template for a CPT created by a plugin
- Nested shortcode functions accessing variable
- Calling an attribute from a plugin shortcode
- accessing wp.media api from a tinymce plugin
- Creating shortcodes in plugin
- Visual Composer shortcode for child theme dir
- How to create a custom shortcode based on the layout?
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Create shortcode to echo javascript
- Custom Shortcode Broken in WordPress 3.1
- Namespaced shortcode?
- My plugin won’t return anything [closed]
- Shortcode to update user meta
- Why shortcode always displayed after footer not in body
- Why am I unable to load scripts in head in plugin?
- Deactivate JS Script in Plugin Shortcode
- Where to find the code used to render a page that has a shortcode and a template defined?
- Shortcode not working after move wordpress website files
- convert more tag to shortcode
- Shortcode does not expand in Facebook like
- Plugin that provides the [edit] shortcode?
- Return multiple values in a shortcode attribute
- How to change shortcode’s default theme?
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- Is there a way to convert shortcodes to html content?
- How to use template inside plugin shortcode with variables for big HTML code
- Loop returns the current page’s permalink and guid instead of the post in the loop
- How to rewrite URL and get the values?
- Is there a good way to load tiny_mce_popup.js through editor.windowManager.open?
- How to prevent tabs from opening all at once
- Executing Javascript in Plugin
- Shortcode and variable
- How can I achieve this, using shortcodes
- Elementor Pro display featured image on section -> style -> image using shortcode
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- How To Use do_shortcode with WooCommerce One Page Checkout
- How to get current cart values using WC_Shortcodes?
- insert og image link in wordpress post
- How to check if short code is present in template?
- Why is my shortcode not working?
- Shortcode show error while editing post
- Get Shortcode output to database for static post_content
- Issue Saving Posts That Contain Shortcode
- Using Shortcode Result In Custom HTML Block (Using Google Sheet JQuery Result As NumScroller data-max)
- How to use plugin’s shortcode in custom design? [closed]
- WP Plugin CSS not being applied to page
- How to add HTML to a template only when user is logged out/ not registered
- Multiple calling javascript from shortcode in one page
- How to pass value to a plugins shortcode?
- function of parent not working in childtheme
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Hide some shortcodes on posts from back-end
- Trouble implementing python on WordPress
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- How to display single arbitrary facebook post with a shortcode?
- Custom shortcode with dynamic rewrite
- Posting code inside the post instead of in the template file using shortcode
- How to use shortcode of any plugin to show it visually where i want?
- apply_filters to content but ignore shortcodes
- Why function hooked using object are executing at all time?
- Need to change contact email depending where user is from
- Pulling RSS from site and display it in posts
- Trying to Understand Shortcodes.
- Shortcode return is printing a 1 afterward
- Any way to hook into WP after a page displays?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Invalid argument supplied for foreach()
- cURL External API request displays content above other content on page
- Beginner question: Accessing js script in plugin
- Subtract Using GravityWP Count Plugin
- qTranslate‑X is not translating all shortcodes
- thumbnail_width not working in wordpress most popular post plugin
- Problem with a shortcode generating a error [closed]
- Display file contents within Plugin