Custom Fields
-
I am new to wordpress/widgets/custom fields etc. and I was hoping someone could help me. In addition to the text below, I thought a few screen shots might help explain.
I am using the twenty thirteen theme and am using mp3-jplayer. My goal is to display a different playlist (found in different folders) depending on which page the user clicks on.I have set the MP2j-ui to be displayed on the Second Widget Area. I need to have a Custom Field in order to make a different playlist appear depending on which page the user clicks. I have selected “Mode 1” Custom fields to do this.
I used Advanced Custom Fields to create the custom field.
I called the Group “Song Group” and the Field Label “track” Field Type = Wysiwyg
On the page I included the custom field Song_group and the value was set to:
[mp3-jplayer tracks=”FEED/music” dload=”Y”]When I view the page the player is not displayed.
Thanks in advance for any help.
-
Hello,
let me explain how to get this going without using the ‘Advanced custom fields’ plugin first, so just by writing a regular custom field on a post/page edit screen:1) In the name box write
mp3
2) In the value box writeFEED:/musicNotice the
:which is missing from your shortcode.Autoplay can be set on the widget itself by tickbox.
Basically shortcodes aren’t usually run from the custom fields, so MP3-jPlayer has the method above for using the fields.
Re ‘Advanced custom fields’ plugin – I’ve not actually used it, but I’d say, as per your screenshots – Field Name wants to be
mp3, and it’s best not to use a wysiwyg editor, just a plain text field for the value. Note that this is slightly less flexible than using the fields directly as you’re fixed with having a set key (Field Name), Mp3-jPLayer handles a few variations.Let me know if you can’t get it going and I’ll try help out.
Simon
Thank you so much for your reply.
What you described works well and is exactly what I was looking for.I spent hours trying to figure this out prior to posting the question. Was this method documented somewhere, how would I have known to write mp3 in the name box?
Glad hear you got it going.
It’s Funny, I moved the help a couple of updates ago, but I thinks it’s maybe less visible! It now has it’s own page, but it’s a sub menu of the player’s main settings, so I realise you don’t see it unless you’ve opened the player menu.For completeness, here’s all of the help on custom fields taken from the plugin help:
Custom Fields
————-You can write playlists into the custom fields that are on page and post edit screens (check your ‘screen options’ at top-right if they’re not visible).
They can be picked up with any of the shortcodes (from any page/post, or with the template tag, or by the widgets). See below for how to set them up and some example uses:
1. Enter
mp3into the left hand box (the ‘key’ box).
2. Write the filename, URI, or ‘FEED’ (see above) into the right hand box (the ‘value’ box) and hit ‘add custom field’Add each track or ‘FEED’ in a new field pair.
To add titles and captions in the custom fields use the following format:
1. Add a dot, then the caption in the left hand box, eg:
mp3.My Caption
2. Add the title, then an@before the filename in the right box, eg:My Title@filenameThe keys (left boxes) can be numbered, eg:1 mp3 will be first on the playlist.
Eg. If a custom field key / value pair is set as mp3 / FEED:LIB, then the library is available to any shortcodes, so:
[mp3j]or[mp3t]plays the next track from the library in a single player[mp3j track="3"]or[mp3t track="3"]plays track 3 from the library in a single player[mp3-jplayer]playlists all the custom fields in a playlist player.—–
Simon
The topic ‘Custom Fields’ is closed to new replies.