Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
Can you give more details? What do you hope to achieve with this? –  cpilko Apr 27 '12 at 16:46
    
i use a plugin to replace text if a word is found and want to replace this word with more tag –  Amr Salah Shalaby Apr 27 '12 at 16:50
add comment

1 Answer

up vote 2 down vote accepted

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' );
share|improve this answer
    
not work may be it need to replace <!--more--> with call it's function –  Amr Salah Shalaby Apr 27 '12 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 '12 at 18:38
    
THX alot i fix it –  Amr Salah Shalaby Apr 27 '12 at 19:00
    
Updated your code with prefixing for purposes of best practice. +1 –  m0r7if3r Apr 29 '12 at 22:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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