• Resolved pickme

    (@pickme)


    Hello George!

    I have to use a shortcode to populate long text. Can I use the plugin and shortcode [read more] Your long text [/read] in the form of

    [read more] [description] [/read] to display my long text in the form of :

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit

    Read more

    The one way I can achieve is to hide all the text and display only read more toggle.

    • This topic was modified 2 years, 6 months ago by pickme.
    • This topic was modified 2 years, 6 months ago by pickme.
    • This topic was modified 2 years, 6 months ago by pickme.
    • This topic was modified 2 years, 6 months ago by pickme.
    • This topic was modified 2 years, 6 months ago by pickme.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author George Gkouvousis

    (@gkouvousisg)

    Hey mate.

    You can do that – please try that in text mode.

    If [description] is blocking you or causing conflicts, you can add a PHP block (just ensure that PHP is allowed in your editor, using a proper plugin) and call it using
    <?php echo do_shortcode( '[description]' ); ?>

    Thread Starter pickme

    (@pickme)

    Hello!

    Shortcode [description] inside [read more][/read] populates the text but it is all hidden and displayed in full with the read more toggle.

    The problem with populating the long text with shortcode [description] is that I cannot display a certain portion of the text, say 3 sentences, above the read more toggle that will display the rest of the text.

    I do not think I can use php in the theme’s custom text block but only shortcodes.

    I can add a snippet though using code snippets plugin.

    Can this be achieved?

    Ty

    • This reply was modified 2 years, 6 months ago by pickme.
    Plugin Author George Gkouvousis

    (@gkouvousisg)

    Just use your PHP code in a snippet and use the snippet’s shortcode there.

    Thread Starter pickme

    (@pickme)

    Hi @gkouvousisg,

    I not sure I have understood exactly what to do. I will try your solution and if I encounter difficulties I might contact you again.

    Thank you!

    Thread Starter pickme

    (@pickme)

    Hello George,

    I use [description] to display user generated content from an input textarea form field.

    By embedding the shortcodes in the sequence of [read more][description][/read] all of [description] content is hidden and displays by the read more toggle. This is not what I aim for.

    Is there a way to extract, say, 3 sentences or extract a certain number of letters (always different content since it is user generated) from shortcode [description] in order for the read more/less toggle to be displayed below the content that is always visible (eg the 3 sentences)?

    Thanks

    • This reply was modified 2 years, 6 months ago by pickme.
    • This reply was modified 2 years, 6 months ago by pickme.
    • This reply was modified 2 years, 6 months ago by pickme.
    Plugin Author George Gkouvousis

    (@gkouvousisg)

    Unfortunately, thats an advanced scenario which requires custom development and unfortunately, I cannot provide support for it. My plugin’s goal is very specific.

    While dynamic parts may be included / wrapped in the shortcode of RMWR, static text is supposed to be found there.

    Thread Starter pickme

    (@pickme)

    Hello George,

    Thank you for clarifying this!

    I have alternatively used jQuery to accomplish it.

    Regards

    • This reply was modified 2 years, 6 months ago by pickme.
    Plugin Author George Gkouvousis

    (@gkouvousisg)

    Glad you sorted it out!
    Cheers!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Text populated by shortcode’ is closed to new replies.