You can hardcode shortcodes into a theme using do_shortcode
.
http://codex.wordpress.org/Function_Reference/do_shortcode
echo do_shortcode('[wp-like-locker] Your locked content here... [/wp-like-locker]');
You will most likely want to replace the hard-coded “Your locked content here…” with the function that pulls the content from the editor, like the_content
http://codex.wordpress.org/Function_Reference/the_content
It might look like
// the loop
$content = get_the_content();
echo do_shortcode('[wp-like-locker]' . $content . '[/wp-like-locker]');
Related Posts:
- How do I hardcode a WordPress shortcode into my theme?
- Custom Theme, Custom shortcode not working
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Not able to remove caption shortcode from the content
- Add the shortcodes from the enfold theme to the other theme
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- Colon is Missing In My Website Url in WordPress
- Customizer: active_callback and sanitize_callback incompatibility?
- Custom shortcode outputs plain text instead of HTML at top of post
- My page.php shows the index.php
- How to use wp_add_inline_style for custom CSS added via shortcode?
- Pass php dynamic variable to shortcode
- How can I dynamically update the class in my shortcode?
- Creating own shortcode – echoeing php variable based on JS variable
- How create a Shortcode with hover and complex options
- Remove from shortcode
- Displaying recent posts on static page with template-part via shortcode
- wordpress 4.4 self hosted video (html5) doesn’t show
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- do_shortcode with custom field
- Custom Theme’s “Preview Changes” Doesn’t Work for Previously Published Posts
- How to Reference/Echo Variable from Another PHP Function
- Remove echo from shortcode
- Replace shortcode in substring
- How do I link a button I created in theme customizer to a function?
- 404 error when I acess the second page of post-type
- How to change theme programmatically from a external application?
- Shortcode to show the code
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Shortcode returns values in the wrong order
- Does wordpress templates always in files or in database?
- proper way to add css using functions.php?
- Get URL from shortcode tag
- Embedding PHP in shortcode $content
- Shortcode with PHP issue “Undefined index”
- Excecuting php function in shortcode
- Only first shortcode gets executed
- What does this mean in wordpress? Easy question
- Multiple do_shortcode in page template
- Showing latest post without 301 redirect
- Translate wordpress date from Italian to English
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Returning data instead of echoing/printing
- echo something inside a shortcode
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- Shortcode from a function not working
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Display Data in Table from External Database in WP using Shortcodes
- get_posts works in the page template but not in a shortcode
- Is it possible to return content, and then also continue to do other things?
- Separation of presentation and code – WordPress
- ::before on open/close function [closed]
- anyway to put inside a $outprint=sprintf()
- Is There A Way To Make Theme Files Accept Shortcodes?
- WordPress Customizer Default Image
- How can I include shortcodes within PHP?
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Create a WordPress shortcode using PHP [duplicate]
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- $wpdb returns duplicate posts
- Creating WordPress Shortcode with Variable
- Catchable fatal error: Object of class stdClass could not be converted to string
- Syntax error in a shortcode function
- Do I have anything to worry about when switching to a default theme to test for plugin conflictions?
- Using Shortcode to Grab Archive Listing, Separate by Year
- Capitalize Shortcode Value on Output
- Why in my theme I can’t see all the statics content under the posts?
- get_template_directory adding FTP root folders in urls
- Shortcode to find and replace URL
- Why is my str_replace not working on short code submitted by front-end?
- Could use some help with Shortcodes
- How to integrate noimage picture in this code
- How to put a form with php code into a variable or shortcode?
- Need oop for wordpress theme? [duplicate]
- Unable to process php via shortcode
- Help with WordPress function inside a shortcode
- calling a custom field value inside functions.php
- Using ob_start and ob_get_clean with wordpress shortcode
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Save Custom CSS file in the upload folder dynamically?
- Short code template + ajax
- WordPress shortcode returns the data before
- List all blogs, but exclude the main site
- Shortcode to embed Edit Account form not working
- Warning: printf(): Too few arguments in helpers.php file
- Design with Elementor and code the rest?
- Shortcode not staying inside div tag
- Line breaks inside shortcode variable
- Handling PHP/HTML inside the output of a shortcode function
- Shortcode for Listing Users from Meta Value?
- Cant display an image via PHP in wordpress
- Shortcode to pull posts
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- WordPress and PHP Version Upgrade issue [closed]
- home.php show blog posts as grid view
- PHP code inside Shortcode
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Help Fallback (thumbnail)