Support » Plugin: Custom Content Type Manager » Custom field to upload audio

  • Hey, I am currently developing a WordPress site on a local server using xammp, I’m fairly good with html and css and am starting to get a grasp on PHP but I’m pretty new to it. I have installed CCTM and have been loving it. I have a custom field in my custom post type to upload an mp3 which I would like to display in the audio player in the post, however I cannot figure out how to properly do it with regards to the output filters. From what I can gather the best way to do it would be something along the lines of using “do_shortcode” in my page template with the source being “get_custom_field” etc. I can’t get anything to work for the life of me though and have been digging around online like crazy, I’m assuming my failure is due to my far from perfect grasp of the the PHP syntax. Any help would be greatly appreciated, thanks in advance! 🙂

    https://wordpress.org/plugins/custom-content-type-manager/

Viewing 1 replies (of 1 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    The CCTM doesn’t handle uploads directly. Instead, it attempts to integrate with WP’s existing media library — so the idea is that you upload your assets using WP’s media library and when desired, you can define a custom field that references these assets.

    I’m not sure what the player looks like, but once you’ve got HTML that works, the task becomes generating the dynamic part of that using PHP. Usually this requires printing out the asset URL. You can do this via get_permalink or any of several similar WP functions, or you can use any of the CCTM’s convenience functions. The task boils down to that: convert a post id (specifically an attachment id). There are many examples in WP’s docs for this and I’ve attempted to include examples of this type of scenario throughout the wiki.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom field to upload audio’ is closed to new replies.