• Resolved Ajax30

    (@ajax30)


    I am using the Kodex Posts likes plugin on THIS page, that displays mp3 files with the help of MP3-jPlayer plugin.

    The MP3-jPlayer plugin displays mp3 files from the WordPress media library if the code below is in the custom post:

    <ul class="podcasts">
     	<li>[mp3j track="https://urbansunsets.com/wp-content/uploads/2017/03/urban-sunsets-program-five.mp3" volslider='n']</li>
     	<li>[mp3j track="https://urbansunsets.com/wp-content/uploads/2017/03/urban-sunsets-program-four.mp3" volslider='n']</li>
     	<li>[mp3j track="https://urbansunsets.com/wp-content/uploads/2017/03/urban-sunsets-program-three.mp3" volslider='n']</li>
     	<li>[mp3j track="https://urbansunsets.com/wp-content/uploads/2017/03/urban-sunsets-program-two.mp3" volslider='n']</li>
     	<li>[mp3j track="https://urbansunsets.com/wp-content/uploads/2017/03/urban-sunsets-program-one.mp3" volslider='n']</li>
    </ul>

    I want to upvote (like) every track on the page, instead of the entire page (which is the plugin’s default functionality).

    I came up with:

    <div id="tracks_container">
       <?php
         the_content();
         echo do_shortcode('[kodex_post_like_buttons]');
       ?>
    </div>

    The result of the code above is a single pair of buttons that visitors can use to like or dislike the entire (custom) post, not individual mp3s.

    Can I split the_content(); into list items (mp3 players in the front-end) and add echo do_shortcode('[kodex_post_like_buttons]'); after each list item? How?

    • This topic was modified 7 years, 7 months ago by Ajax30.
Viewing 1 replies (of 1 total)
  • Thread Starter Ajax30

    (@ajax30)

    I have listed every mp3 file in a separate default post that I display on the custom post page like so:

    <ul class="podcasts">
      <?php $catquery = new WP_Query( 'cat=7&posts_per_page=30&order=DESC' );
        while($catquery->have_posts()) : $catquery->the_post();
      ?>
       <li class="track-list-item"><?php the_content();?></li>
      <?php endwhile;?>
    </ul>

    I have inserted the plugin’s shortcode manually on every track’s post. It works!

    • This reply was modified 7 years, 7 months ago by Ajax30.
Viewing 1 replies (of 1 total)
  • The topic ‘Vote media items (mp3 files) on a page’ is closed to new replies.