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
- esc_attr() right way and use
- Is having multiple theme customizers for different pages possible?
- Shortcode to insert
- Shortcode putting html such as
- Detection of theme being used
- Replacing mysql_real_escape_string in WordPress theme
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Using Echo in ShortCode – Stuck
- Multiple do_shortcode($content) within one shortcode
- Can’t Find a Way to Edit the Home Page Content [closed]
- Fatal error: Call to undefined function wpsc_cart_item_count()
- My shortcode is showing up twice
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- WordPress menu deletes when trying to add a hook
- Widgets not showing in my custom theme
- How to find the output of contact form 7 shortcode? [closed]
- How do i get (unique) page name?
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Browser title script ignoring is_page /else conditional [closed]
- Nested shortCode functions in the functions.php file
- How the functions in WP are called in tags
- get_page_by_title with an apostrophe in variable
- Making Quote Plugin more efficient
- How to limit the content coming from wordpress shortcodes?
- Add a Second Menu to a theme that only support 1 menu
- How can I get content inside one shortcode to another shortcode?
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- Use WP_Query in shortcode
- Customizer: Output default value in Customizer CSS
- WordPress does not load page.php, return 404.php
- WordPress add post format support not working
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- Calculating a large number of MYSQL queries as customshort codes, slow
- How can I dynamically update the class in my shortcode?
- How to Reference/Echo Variable from Another PHP Function
- Replace shortcode in substring
- 404 error when I acess the second page of post-type
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Does wordpress templates always in files or in database?
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- 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
- Capitalize Shortcode Value on Output
- Why is my str_replace not working on short code submitted by front-end?
- How to integrate noimage picture in this code
- Need oop for wordpress theme? [duplicate]
- Shortcode not staying inside div tag
- Help Fallback (thumbnail)
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- get_comments_number() returns 0
- Shortcode function doesnt work without caption
- Fatal errors to undefined function in theme 404.php file [closed]
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- How to make sure relative URL works when site is not on root domain?
- Editing Theme Files on WordPress.com-hosted Site [closed]
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Wrap title and excerpt in a div (latest posts block)
- How to set all External Domain Links with nofollow Attribute from Header Footer Content and Excerpt using PHP?
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- How to Create custom block for displaying information in content section which act like shortcode
- Display logged in user name and lastname on page
- remove_action from parent theme using child theme functions.php
- Replace background image with post thumbnail in shortcode
- Conditional formatting on data fetched from MYSQL
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Force Sidebar on Full Width page
- Display current user metadata on WordPress page
- Add Shortcode to ::before class
- Reload page with a different shortcode when a user selects from a dropdown
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- PHP Error in WordPress Theme
- Shortcode’s output to use as other shortcode’s parameter
- Show products per shortcode
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- Add two or multiple functions in WordPress Post or Page
- Shortcode Works for Logged in Users but Not Working for Guest
- perform mathematical operation on shortcode
- Update same content in multiple posts at once?
- problem multisite with blog id
- Editted Theme Files Get Updated/Reverted Every So Often
- Create dynamic content from one WP page to multiple other pages
- Do_shortcode on PHP file outside theme ALMOST works
- How can I print out a single stylesheet or javascript link?
- Custom Shortcode with Dynamic Button
- Predefine Magazine Style Layouts
- Shortcode for Visual Composer Grid fails turning string to integer
- How to store the_post_thumbnail() value in a variable
- 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?