The MU forums have moved to WordPress.org

modify Videographer theme to grab first post from each blog (7 posts)

  1. STDestiny
    Member
    Posted 14 years ago #

    I've been trying to modify the code in the theme "Videographer" (See http://www.zoomstart.com/videographer-wordpress-theme/ ) to pull only the first post (i.e., 'Hello World') from each blog. I'm starting a site where the first post will be a video recorded by me and uploaded to youtube.

    Can anyone help me? I'd prefer to just use hard code rather than trying to manipulate any plugins

  2. andrea_r
    Moderator
    Posted 14 years ago #

    So... on each new blog created, the content of the first post is a video by you, and you only want that post to show on the blog?

    Or are you trying to get the first post from each blog, to be shown in one blog? (that's how the sentence was written)

  3. STDestiny
    Member
    Posted 14 years ago #

    The second one. I'm manually creating the blog, and manually editing the first post to add the youtube video in. I'd like to aggregate the first post from each blog on the front page.

    It would also be fine if I have to tag them and pull them using sitewide tags, but it would have to work with the code in the aggregator theme that grabs the "preview" image from youtube. (So you know what I'm talking about, here's the code that is put within the loop)

    <?php $vids = get_post_meta($post->ID, 'vids', true); ?>
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="http://img.youtube.com/vi/<?php echo($vids) ?>/2.jpg" alt="<?php the_title(); ?>" width="130px" height="97px" /></a>

    The theme requires a custom field called "vids" with the value being the youtube ID of the video, which allows it to grab the thumbnail from youtube.

    Thanks,
    Andrew

  4. andrea_r
    Moderator
    Posted 14 years ago #

    Sitewide tags plguin, with the mod here in the forum to grab the custom fields.

    http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/

    Tell it to use the main blog. Presto!

  5. STDestiny
    Member
    Posted 14 years ago #

    Ok thanks. I have two problems though,

    First, how do i set it to show only posts with a specific tag? As it is it looks like it will show any post that has a tag.
    Edit: I figured this out by adding a query_post arguement surrounding the loop

    doesn't seem to be grabbing the youtube preview images, just links to http://img.youtube.com/vi//2.jpg (the youtube id is supposed to go in between the double //'s)
    Edit: Ok, so I just realized that the plugin isn't copying over the custom field from the original blog. Is there a way to modify the plugin to do that? or failing that, maybe to a regex on the content of the posts to get the value after "www.youtube.com/watch?v="

  6. STDestiny
    Member
    Posted 14 years ago #

    Doh! I should have known to do a forum search! Found the answer at http://mu.wordpress.org/forums/topic/13198?replies=4

    Thanks for your help, andrea! You rock as always!

  7. andrea_r
    Moderator
    Posted 14 years ago #

    Glad you got it all figured out. :)

About this Topic

  • Started 14 years ago by STDestiny
  • Latest reply from andrea_r