0

is there is a way to convert <!-- more --> to shortcode

2
  • Can you give more details? What do you hope to achieve with this?
    – cpilko
    Apr 27, 2012 at 16:46
  • i use a plugin to replace text if a word is found and want to replace this word with more tag Apr 27, 2012 at 16:50

1 Answer 1

2

Try adding this to your plugin file (or functions.php). You'll use [my_more] as the shortcode for this example.

function wpse50449_more_func( $atts ){
 return "\n<!-- more -->\n";
}
add_shortcode( 'my_more', 'wpse50449_more_func' );
4
  • not work may be it need to replace <!--more--> with call it's function Apr 27, 2012 at 18:08
  • That will give you <!--more--> from a shortcode. More information about what you're actually trying to accomplish with this would get you a better answer.
    – cpilko
    Apr 27, 2012 at 18:38
  • THX alot i fix it Apr 27, 2012 at 19:00
  • Updated your code with prefixing for purposes of best practice. +1
    – mor7ifer
    Apr 29, 2012 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.