12 pointsStarting to get into this DEV thingI'm new here
maladymg
Member
—
26th August 2010 19:38
I'm not much of a programmer, how would I go about changing the avatar in the recent global post widgets to being the featured image in the post or the first image uploaded to a post?
I'm also looking to be able to display blocks of posts from different blogs on the site. Since my network isn't open to registration I can make sure whatever is needed in each blog to pull it from (like a featured category), but I'd like to be able to showcase a block of posts from each blog with the post image rather than the author avatar. Ie 4 posts from blog id 3 with the post image.
I'm beginning level with php but good with css so when I look at the example code I was given
Is confusing to me. If I saw the code in action I could likely make it work.
Any help would be appreciated. Basically I'm trying to build a magazine type site where different topics are in their own blogs so I can brand each blog differently.
I'm not much of a programmer, how would I go about changing the avatar in the recent global post widgets to being the featured image in the post or the first image uploaded to a post?
I'm also looking to be able to display blocks of posts from different blogs on the site. Since my network isn't open to registration I can make sure whatever is needed in each blog to pull it from (like a featured category), but I'd like to be able to showcase a block of posts from each blog with the post image rather than the author avatar. Ie 4 posts from blog id 3 with the post image.
I'm beginning level with php but good with css so when I look at the example code I was given
Is confusing to me. If I saw the code in action I could likely make it work.
Any help would be appreciated. Basically I'm trying to build a magazine type site where different topics are in their own blogs so I can brand each blog differently.
It'd be a fairly complex, as a beginner, to create the functions you're looking for - and you'd have to modify the Recent Global Posts Widget which would be an issue for upgrades.
A developer should be able to get this done for you, so my advice would be to check out our WPMU Job boards and post a request there.
That being said, I'm not sure where you're getting the sample code above, but looking at line 165 in widget-recent-global-posts.php is where the call for get_avatar takes place. You could start by replacing that function ;D
I'm not one for paying other people to do the work for me.. I learn nothing that way. It doesn't matter how complex it is, if I can find the information to get it together I can do it myself. I find it difficult to believe it would be extremely complicated to pull blog posts from a specific blog to the front page of the main blog. Perhaps you are misunderstanding what I'm asking for. I'm a beginner at php but I know the wordpress loop fairly well, I design wordpress themes for a living. This is my first venture into multi blogs.
I guess paying as much as this cost I was expecting a higher level of support. I can get a hire a coder response anywhere.
Thanks.
Next take a look at how the widget pulls the author avatar (this is the section I mentioned around line 165) and make a replacement there as you don't want the avatar, you want post images.
Again, this should help you get started. Let us know how it goes! :D
Thanks, I wasn't sure if it was usually different calls since its MU and not regular wordpress. I think where my confusion lies is how do I pull it from a specific blog. In regular wordpress I can pull from a category or a custom form field, tag etc... In the widget and recent global posts plugin that is not the widget it pulls from all the blogs. I'm trying to figure out how to specify by blog or blog category in a specific blog number. It doesn't have to be in a sidebar widget, in fact I'd prefer that it wasn't. I guess i was asking more than one question.
In regular wordpress if I want to pull a specific category I can use a code similar to
6593 pointsLike some sort of WPMU DEV GodExceptionally helpfulLifetime member
Keeper of the Dark Chocolate
—
29th August 2010 14:27
#
I'm sitting on a park bench trying to play catch up. If you can wait until Monday, I can take a look at this. Was down for three days due to a bad sensor on the laptop. :(
Responses (8)
Sales & Support Lead — 26th August 2010 21:43 #
Hiya!
It'd be a fairly complex, as a beginner, to create the functions you're looking for - and you'd have to modify the Recent Global Posts Widget which would be an issue for upgrades.
A developer should be able to get this done for you, so my advice would be to check out our WPMU Job boards and post a request there.
That being said, I'm not sure where you're getting the sample code above, but looking at line 165 in widget-recent-global-posts.php is where the call for get_avatar takes place. You could start by replacing that function ;D
Hope this helps somewhat!
Thanks.
Member — 26th August 2010 21:47 #
I'm not one for paying other people to do the work for me.. I learn nothing that way. It doesn't matter how complex it is, if I can find the information to get it together I can do it myself. I find it difficult to believe it would be extremely complicated to pull blog posts from a specific blog to the front page of the main blog. Perhaps you are misunderstanding what I'm asking for. I'm a beginner at php but I know the wordpress loop fairly well, I design wordpress themes for a living. This is my first venture into multi blogs.
I guess paying as much as this cost I was expecting a higher level of support. I can get a hire a coder response anywhere.
Thanks.
Sales & Support Lead — 27th August 2010 00:56 #
Hiya,
Wasn't my intention to sound like there was no other option than hiring a developer.
You definitely can do it!
I'd start here for the function to grab an image from a post:
http://codex.wordpress.org/Function_Reference/the_post_thumbnail
Next take a look at how the widget pulls the author avatar (this is the section I mentioned around line 165) and make a replacement there as you don't want the avatar, you want post images.
Again, this should help you get started. Let us know how it goes! :D
Member — 27th August 2010 01:13 #
Thanks, I wasn't sure if it was usually different calls since its MU and not regular wordpress. I think where my confusion lies is how do I pull it from a specific blog. In regular wordpress I can pull from a category or a custom form field, tag etc... In the widget and recent global posts plugin that is not the widget it pulls from all the blogs. I'm trying to figure out how to specify by blog or blog category in a specific blog number. It doesn't have to be in a sidebar widget, in fact I'd prefer that it wasn't. I guess i was asking more than one question.
In regular wordpress if I want to pull a specific category I can use a code similar to
I'm not sure how to pull this from category "featured" in blog id 6
I appreciate the response. Thanks for your help.
Member — 29th August 2010 01:42 #
anyone?
Keeper of the Dark Chocolate — 29th August 2010 14:27 #
I'm sitting on a park bench trying to play catch up. If you can wait until Monday, I can take a look at this. Was down for three days due to a bad sensor on the laptop. :(
Member — 5th September 2010 19:54 #
no problem. just really trying to get this figured out. I appreciate it.
Developer — 5th September 2010 21:26 #
Add
switch_to_blog(6); //blog id is 6before the code you would use for a simple wordpress install, andrestore_current_blog();after it.So, for the example code you provided, you would do:
<?php switch_to_blog(6); ?>
<?php $recent = new WP_Query("cat="xxxxxx"&showposts="('4')); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, "thumb", true) ): ?>
" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=75&w=75&zc=1" alt="<?php the_title(); ?>" />
<?php endif; endwhile; ?>
<?php restore_current_blog(); ?>
Become a member