Support » Plugins » Generate or automatically add a tag in a shortcode or function

  • Hi!
    I’m going nuts over this issue. I’d like to make a shortcode (or something) that generates the needed “read more” <!--more--> tag. No matter what I do, it does not seem to work. I’ve tried basically everything online, so I need a proper example for this.

    Can I print the quicktag somehow? just doing an echo or return does not work. It gets printed, but the function of it gets ignored.

    The reason why I need this is to help automate posts that are NOT written directly in the post editor, but imported from i.e or someplace else outside WordPress.

    I know I can add the quicktag manually, but I want this done somewhat automatically or generated.

    If I set a default post content of some sorts, I can just write the tag and it works, but then it does not work for mobile posts, or imported posts, since the default content stays put instead of the content of the wanted imported post.

    This is what I have for now:

    function my_shortcode_function() { 
        return '<!--more-->';
        $output = ob_get_clean();		
    		return $output;
    add_shortcode('more', 'my_shortcode_function');

    Any help is appreciated. I’m a noob, so I only understand basic code, so keep it simple.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Generate or automatically add a tag in a shortcode or function’ is closed to new replies.