Reduce the number of YouTube videos shown in topics and posts

View previous topic View next topic Go down

Reduce the number of YouTube videos shown in topics and posts Empty Reduce the number of YouTube videos shown in topics and posts

Post by Guest 1/22/2015, 4:25 pm

avatar
Guest
Guest


JS placement 'In the topics':

Code:
$(document).ready(function() {
   
    var videos = '4'; /* videos converted to URL after 5 videos. 4 = 5, 0 = 1 */
   
    $('.post .content embed:gt('+videos+')').each(function() {
      var src = $(this).attr('src');
      $(this).before('<a href="'+src+'" target="_blank">'+src+'</a>').remove();
    });
});

This example is for 5 videos being shown, 6th etc will be made URLs only.

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum