How do I write a shortcode that opens and closes?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I want to have a shortcode like this:



[readmore]Lorem ipsum dolor sit amet, consectetur adipiscing elit...[/readmore]









share|improve this question







New contributor




Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    up vote
    1
    down vote

    favorite












    I want to have a shortcode like this:



    [readmore]Lorem ipsum dolor sit amet, consectetur adipiscing elit...[/readmore]









    share|improve this question







    New contributor




    Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I want to have a shortcode like this:



      [readmore]Lorem ipsum dolor sit amet, consectetur adipiscing elit...[/readmore]









      share|improve this question







      New contributor




      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I want to have a shortcode like this:



      [readmore]Lorem ipsum dolor sit amet, consectetur adipiscing elit...[/readmore]






      plugin-development shortcode






      share|improve this question







      New contributor




      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 hours ago









      Coomie

      1263




      1263




      New contributor




      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          I found the correct way:



          function readmore_link($defaults,$between_the_tags)
          ...

          $output = 'This is between the shortcode tags:';
          $output .= $between_the_tags;

          return $output;

          add_shortcode('readmore', 'readmore_link');





          share|improve this answer








          New contributor




          Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "110"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Coomie is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f316889%2fhow-do-i-write-a-shortcode-that-opens-and-closes%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            I found the correct way:



            function readmore_link($defaults,$between_the_tags)
            ...

            $output = 'This is between the shortcode tags:';
            $output .= $between_the_tags;

            return $output;

            add_shortcode('readmore', 'readmore_link');





            share|improve this answer








            New contributor




            Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















              up vote
              2
              down vote













              I found the correct way:



              function readmore_link($defaults,$between_the_tags)
              ...

              $output = 'This is between the shortcode tags:';
              $output .= $between_the_tags;

              return $output;

              add_shortcode('readmore', 'readmore_link');





              share|improve this answer








              New contributor




              Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.



















                up vote
                2
                down vote










                up vote
                2
                down vote









                I found the correct way:



                function readmore_link($defaults,$between_the_tags)
                ...

                $output = 'This is between the shortcode tags:';
                $output .= $between_the_tags;

                return $output;

                add_shortcode('readmore', 'readmore_link');





                share|improve this answer








                New contributor




                Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                I found the correct way:



                function readmore_link($defaults,$between_the_tags)
                ...

                $output = 'This is between the shortcode tags:';
                $output .= $between_the_tags;

                return $output;

                add_shortcode('readmore', 'readmore_link');






                share|improve this answer








                New contributor




                Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 2 hours ago









                Coomie

                1263




                1263




                New contributor




                Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Coomie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




















                    Coomie is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    Coomie is a new contributor. Be nice, and check out our Code of Conduct.












                    Coomie is a new contributor. Be nice, and check out our Code of Conduct.











                    Coomie is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f316889%2fhow-do-i-write-a-shortcode-that-opens-and-closes%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery