• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Multiple loops on same page with different image sizes?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Multiple loops on same page with different image sizes?

This topic is: resolved

Tagged: custom loop, featured image

  • This topic has 7 replies, 2 voices, and was last updated 7 years, 9 months ago by Henrik Blomgren.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • October 27, 2014 at 6:43 am #129426
    Henrik Blomgren
    Member

    Hi 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/s1x4grepxk07c3mx0utb

    If 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 #129560
    Brad Dalton
    Participant

    Try this: http://codex.wordpress.org/Class_Reference/WP_Query#Multiple_Loops


    Recent Client work

    October 28, 2014 at 9:32 am #129587
    Henrik Blomgren
    Member

    Thanks 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 #129600
    Brad Dalton
    Participant

    Try it and see how you go then report back.


    Recent Client work

    October 29, 2014 at 1:43 am #129674
    Henrik Blomgren
    Member

    It 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 #130799
    Henrik Blomgren
    Member

    Well. 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 #130803
    Brad Dalton
    Participant

    Looks 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


    Recent Client work

    November 7, 2014 at 10:43 am #130811
    Henrik Blomgren
    Member

    I noticed that... made some changes to the plugin and replaced the shortcode used. So last time I checked it worked.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble