Community Forums › Forums › Archived Forums › Design Tips and Tricks › Multiple loops on same page with different image sizes?
Tagged: custom loop, featured image
- This topic has 7 replies, 2 voices, and was last updated 10 years, 5 months ago by
Henrik Blomgren.
-
AuthorPosts
-
October 27, 2014 at 6:43 am #129426
Henrik Blomgren
MemberHi Studiopress forum,
I want to ask you something. I´m redesigning my portfolio. I want the front page to look like this image
https://app.box.com/s/s1x4grepxk07c3mx0utbIf I had done this the "normal" way with php I would have divided it into 3 parts. One Intro, one Portfolio and one Blog. Each part would have gotten either widget or php code written onto it. Most likely I would have sent the reader to a special file called front-portfolio for the portfolio part for example.
But with genesis I do feel I am a bit lost. I found the custom_genesis_loop and used it.
So I did two queries for use on the front page only. Now I want to ask if it´s the right way that I used em.
There are the two queries I did:
$args = array(
'post_type' => array('portfolio'), // exclude posts from this category
'posts_per_page' => 12, // respect pagination
'paged' => $paged,
);$blogargs =array(
'post_type' =>array('post'),
'posts_per_page' => 6,
'paged' => $paged
);Then I call them with genesis_custom_loop($args/$blogargs) respecitvely. But this means that the same image size will be used in both loops. Is there any way to change the featured image used for each custom loop?
As always if this is way above the help of this forum then I am sorry for asking. No URL at this point so I can´t show you the code in action.
thanks for you help.
October 28, 2014 at 7:09 am #129560Brad Dalton
ParticipantOctober 28, 2014 at 9:32 am #129587Henrik Blomgren
MemberThanks Brad!
So I just have to put wp_reset_postdata(); after each genesis_custom_loop();? Is that a good way of doing it with Genesis? Since it´s that I´m worried about. If genesis plays nicely with everything.
October 28, 2014 at 10:18 am #129600Brad Dalton
ParticipantOctober 29, 2014 at 1:43 am #129674Henrik Blomgren
MemberIt seems to work. The posts are output and they work well as I want them to. But I don´t see any difference in output from when I did not have wp_reset_postdata(); after the loops. So I´m guessing it works.
Thanks for the help Brad. Hopefully I´ll work out the quirks soon and can show it all 🙂
November 7, 2014 at 9:45 am #130799Henrik Blomgren
MemberWell. The new design is up and running over at http://henrikblomgren.net. Front page uses custom queries and from what I see in the outputted code it displays no errors so I guess it worked fine. Thanks once again for the help Brad!
November 7, 2014 at 9:58 am #130803Brad Dalton
ParticipantLooks fine except for your after posts plugin
Notice: Undefined index: _block_id in /storage/content/10/126410/henrikblomgren.net/public_html/wp-content/plugins/ads-by-datafeedrcom/inc/dfads.class.php on line 205 Notice: Undefined index: _block_id in /storage/content/10/126410/henrikblomgren.net/public_html/wp-content/plugins/ads-by-datafeedrcom/inc/dfads.class.php on line 208
November 7, 2014 at 10:43 am #130811Henrik Blomgren
MemberI noticed that... made some changes to the plugin and replaced the shortcode used. So last time I checked it worked.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.