• Resolved John

    (@jpmizell)


    Howdy,

    I’m looking to work this widget into spaces outside of my content for better off-site & excerpt reading.

    I don’t like it appearing in my excerpts (I’m including all code in my excerpts), so I’d like to grab the iTunes Album Id#, put it into a custom field, and have it push to the widget that is located elsewhere on the post, out of the content section. (similar to a featured image).

    Does something like this exist or will this be a long lonesome journey for me?

    https://www.ads-software.com/extend/plugins/music-affiliate-pro/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Brady Vercher

    (@bradyvercher)

    Hi jpmizell,

    Direct support for doing this isn’t exactly built in, but it should be possible depending on how comfortable you are modifying your files (back them up before making changes and you should be fine).

    If you’re putting the iTunes ID into a custom field, you will need to grab that in your template using get_post_meta().

    Then construct a dummy shortcode string: $shortcode = "[itunes id='$meta_value']"

    And run that through do_shortcode()

    That should allow you to output the widget anywhere outside of the content section.

    Hope that helps.

    – Brady

    Thread Starter John

    (@jpmizell)

    Brady,

    Thanks for the quick word.

    After fumbling with your helpful code suggestions, here’s what I’ve got stashed in single.php

    <!-- iTunes music Box Code -->
    <?php
    	$meta_values = get_post_meta($post->ID, 'itunes_id', true ) ;
    //	echo ' | $meta_values: ', $meta_values ;
    	$itunes_shortcode = "[itunes id='$meta_values']" ;
    //	echo ' | $itunes_shortcode: ' , $itunes_shortcode ;
    	echo do_shortcode( $itunes_shortcode ) ;
    ?>
    <!-- end of iTunes Music Box Code -->

    Thanks for the direction.

    John

    Thread Starter John

    (@jpmizell)

    *Note: The echo lines were a check for functionality. Disregard them.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Music Affiliate Pro] Album Specific Widget Outside of Content’ is closed to new replies.