Hi! I had the same problem and I managed to make a lot of workarounds using the shortcodes and… Sort of hack php methods.
I’m no programmer, so everything I’m going to put here has been done for the sake of my projects. So if it breaks up the css or things on your page, I warned you ;).
So, the first thing I did was to add in my theme header the mp3j_addscripts() function. You have to find the <?php wp_head(); ?>
tag in it and just before that line put <?php mp3j_addscripts() ?>
so you can add any mp3-jplayer shortcodes on your theme.
Second, In your theme category.php check up where you want to put your list, and modify this code to make it fit your needs
<div id="yourcssid">
<h1 style="border-bottom: 1px solid #000;">Player</h1>
<div class="mp3j-popout-MIO" onclick="return launch_mp3j_popout('https://radio.struments.com/wp-content/plugins/mp3-jplayer/popout-mp3j.php',0);" style="visibility: visible;"></div>
<div class="clear"></div>
<?php
$args = array(
'post_per_page' => 99, // An arbitrary number. Set high enough to be sure to get 5 posts with attachments
'caller_get_posts' => 1, // Ignore stickies
'category_name' => single_cat_title("", false),
);
$myquery = new WP_Query($args);
if ($myquery->have_posts()) {
$postcount = 1;
while ($myquery->have_posts()) {
$myquery->the_post();
if ($postcount > 99) break;
$attachment_args = array(
'post_type' => 'attachment',
'post_mime_type' => 'audio',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
);
if (!empty($mp3s));
$attachments = get_posts($attachment_args);
if ($attachments) {
++$postcount;
foreach ($attachments as $attachment) { ?>
<center><object width='10%' id='single<?php echo $mp3->ID; ?>' name='single<?php echo $mp3->ID; ?>'>
<?php $url= $attachment->guid; ?>
<?php $titl = $attachment->post_title; ?>
<?php $cont = $attachment->post_content; ?>
<?php echo mp3j_put( '[mp3j track="'.$titl.'@'.$url.'" captions="'.$cont.'"]' ); ?>
<div class="subtitle" style="text-align: left; border-top: 2px dotted #AAA"><?php echo $cont = $attachment->post_content; ?></div>
</object></center>
<?php break;
}
}
}
}
?>
</div>
</div>
As you can see what I’m doing is getting a new WP query to extract all the audio from the current category, then using that selection to create a “For each” loop where I declare some variables to extract the data from the files as url, tittle and content then put the [mp3j track=] shortcode with the values I just extracted.
If you want to use this for the Player with the playlist just use the same principle but using some variables to modify the resulting loop to one string.
Here I do that but for my files in the current page (Index) with an “if” that makes a playlist with the FEED:LIB if it doesn’t find any file.
<?php $mp3s = get_children( 'numberposts=-1&post_type=attachment&post_mime_type=audio&post_parent='.$post->ID );if (!empty($mp3s)) : ?>
<?php foreach($mp3s as $mp3): ?>
<?php $url= $mp3->guid; ?>
<?php $titl = $mp3->post_title; ?>
<?php $cont = $mp3->post_content; ?>
<?php $fulurl .= $titl."@".$url.","; ?>
<?php $Capt .= $cont.";"?>
<?php endforeach;?>
<?php echo mp3j_put( '[mp3-jplayer tracks="'.$fulurl.'" captions="'.$Capt.'" stop="n" list="y"]'); ?>
<?php else: ?>
<?php echo mp3j_put( '[mp3-jplayer tracks="FEED:LIB" stop="n" list="y"]'); ?>
<?php endif; ?>
I’m sorry for my bad English and my messy code :/, I hope this help you to archive what you are trying to do.
??