• Resolved designkamer

    (@designkamer)


    Hello,

    I want to import a Spotify embedded code with a pods custom field, but when I want to add it in the Elementor editor, nothing is showing.

    The fields I tried are:

    • Html (with oEmbed enabled)
    • oEmbed
    • Plain text (with allow html enabled and sanitize script disable)
    • WYSIWYG (TinyMCE editor and oEmbed allowed)

    I tried importing it in the Elementor editor with the widgets:

    • html
    • Paragraph

    Could you please tell me what I’m doing wrong?

    Thank you and kind regards,

    Angela

    • This topic was modified 1 month, 3 weeks ago by designkamer.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Paul Clark

    (@pdclark)

    The template might be processing oEmbeds before shortcodes, causing the content to not appear as expected.

    Try adding a new shortcode:

    <?php
    /**
    * Plugin Name: Spotify Embed from Field
    * Description: <code>[spotify]</code> shortcode to embed from field named <code>spotify_url</code>.
    */
    add_shortcode(
    'spotify',
    function( $atts, $content, $tag ) {
    return $GLOBALS['wp_embed']->run_shortcode(
    sprintf(
    '[embed]%s[/embed]',
    get_post_meta( get_the_ID(), 'spotify_url', true )
    )
    );
    }
    );

    …by either adding that code in a new folder/file.php within wp-content/plugins, or using a Code Snippets plugin.

    In the example, spotify_url is the name of the field, the shortcode is [spotify], and the field should pull from the current global post object being viewed.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.