Jump to content

AshleyQuick

Members
  • Posts

    33
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

AshleyQuick's Achievements

Member

Member (2/5)

0

Reputation

  1. That could work but is it possible to have everything contained in the script (without the external text file)? I'm using this in Wordpress so I'd like to edit in one place only.
  2. Random on page load. And yep, a php snippet. I found something similar here: <?php $content = array( 'http://www.address1.com|image1|Caption 1', 'http://www.address2.com|image2|Caption 2', 'http://www.address3.com|image3|Caption 3', 'http://www.address4.com|image4|Caption 4' ); shuffle($content); foreach ($content as $value) { $explode = explode('|', $value); echo '<p><a href="' . $explode[0] . '"><img src="/misc/php/shuffle/' . $explode[1] . '.gif" border="0" width="100" height="25" align="absmiddle"></a> <a href="' . $explode[0] . '">' . $explode[2] . '</a></p>'; } ?> But I couldn't get that to work with the YouTube code.
  3. Can someone assist with a code snippet that will randomly display YouTube videos using their embed code? <iframe width="560" height="315" src="//www.youtube.com/embed/bYI_aOyCn9Y" frameborder="0" allowfullscreen></iframe> I'd like to cycle through 3-4 videos.
  4. %3$s displays a string of text that always begins with a number followed by a colon (from 1-25 only). 1: 2: 3: etc... Is there a way to remove the number and the colon entirely and leave the rest of the string intact? function wp_rss( $url, $num_items = -1 ) { if ( $rss = fetch_rss( $url ) ) { if ( $num_items !== -1 ) { $rss->items = array_slice( $rss->items, 0, $num_items ); } //start count $i = 1; foreach ( (array) $rss->items as $item ) { printf( '<div title="%2$s"><strong>'.$i.'</strong></div><div>%3$s</div>', esc_url( $item['link'] ), esc_attr( strip_tags( $item['description'] ) ), htmlentities( $item['title'] ) ); //increment $i++; } Ashley
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.