Jump to content

[SOLVED] Foreach loop for more templates


mntob
 Share

Recommended Posts

I've just started to use Processwire, for now I'm very happy,  for now I have one question, sorry if this is a beginner question?.

is it possible to make foreach loop like this?

 <?php foreach ( $pages->find('template=itemProduct1ingle, itemProduct2ingle,  sort=-created') as $all ):?>               
    <div class="col-12 col-md-6 col-lg-4 col-xl-3">
            <h6><a href="<?=$all->url?>"><?=$all->title?></a></h6>
        </div>
<?php endforeach; ?>

I need to list all items from two templates on home page, I hope you understand me ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...