Site logo

[Resolved] Creating several shortcodes for use with Elements

Home Forums Support [Resolved] Creating several shortcodes for use with Elements

Home Forums Support Creating several shortcodes for use with Elements

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2483719
    Ola

    Hi!

    Sorry if this is a bit “off-topic” …

    Basic usecase: I want to insert text/blocks into a blog article (as generic promos of other articles or products). The “generate_after_content” hook is too far down, below post meta, navigation and a social sharing plugin (social snap). I’d like to be able to use different texts for different posts and sometimes two shortcodes in the same post.

    I’ve implemented the shortcode-to-hook connection as described in https://generatepress.com/forums/topic/hook/#post-1038253

    If I want to add more shortcodes to use simultaneously in same or different articles, should I duplicate the script in the linked post or would the code be different?

    Thanks for awesome support!

    /Ola

    #2483784
    David
    Staff
    Customer Support

    Hi there,

    use the shortcode here:

    https://generatepress.com/forums/topic/block-element-inside-another-block-element-content/#post-2470709

    That way you can use the one shortcode to create different named custom hooks.

    #2483966
    Ola

    Brilliant!

    Thanks!

    #2484355
    David
    Staff
    Customer Support

    Glad to be of help

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.