Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4573900
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:50:58+00:00 2026-05-21T19:50:58+00:00

In PHP (wordpress), I understand how to make a basic loop- however I’m not

  • 0

In PHP (wordpress), I understand how to make a basic loop- however I’m not so sure how to make a single query and output that into 2 seperate areas like below:

<div class="slides_container"> 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-3-2x.jpg" width="366" alt="1144953 3 2x"></a> 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-1-2x.jpg" width="366" alt="1144953 1 2x"></a> 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-2-2x.jpg" width="366" alt="1144953 2 2x"></a>                 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-4-2x.jpg" width="366" alt="1144953 4 2x"></a> 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-5-2x.jpg" width="366" alt="1144953 5 2x"></a> 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-6-2x.jpg" width="366" alt="1144953 6 2x"></a> 
                <a href="http://www.zappos.com/pro-keds-royal-plus-lo-grey" target="_blank"><img src="img/1144953-p-2x.jpg" width="366" alt="1144953 P 2x"></a> 
            </div> 
            <ul class="pagination"> 
                <li><a href="#"><img src="img/1144953-3-2x.jpg" width="55" alt="1144953 3 2x"></a></li> 
                <li><a href="#"><img src="img/1144953-1-2x.jpg" width="55" alt="1144953 1 2x"></a></li> 
                <li><a href="#"><img src="img/1144953-2-2x.jpg" width="55" alt="1144953 2 2x"></a></li> 
                <li><a href="#"><img src="img/1144953-4-2x.jpg" width="55" alt="1144953 4 2x"></a></li> 
                <li><a href="#"><img src="img/1144953-5-2x.jpg" width="55" alt="1144953 5 2x"></a></li> 
                <li><a href="#"><img src="img/1144953-6-2x.jpg" width="55" alt="1144953 6 2x"></a></li> 
                <li><a href="#"><img src="img/1144953-p-2x.jpg" width="55" alt="1144953 P 2x"></a></li> 
            </ul> 
        </div> 

Basically I need to understand how to make the 2 content areas “match up”, so if I were to run a random query, the #3 Anchor would match the #3 Li inside the UL. Do I need to run a “forEach”?

This is for a jQuery slider, so the List elements are simply navigation thumbnails for the main piece.

Anyone have a clue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T19:50:58+00:00Added an answer on May 21, 2026 at 7:50 pm

    I’m making some assumptions here – but basically you could use a foreach loop twice – the first time populating the initial HTML “a” links, and a second loop to populate the li.

    For example – if your array is called items and it contained 4 key-value pairs for each element, you’d do something like this:

    <div class="slides_container"> 
    <?php
    foreach ($items as $i) {
        ?>
        <a href="http://www.zappos.com/{$i['url_slug']}" target="_blank"><img src="img/{$i['img_name']}" width="366" alt="{$i['alt_text']}"></a>
        <?php
    }
    ?>
    </div> 
    <ul class="pagination">
    <?php
    foreach ($items as $i) {
    ?>
        <li><a href="#"><img src="img/{$i['img_name']}" width="55" alt="{$i['alt_text']}"></a></li> 
        <?php
     }
     ?>
     </ul> 
     </div> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a small PHP application several months ago that uses the WordPress XMLRPC
I noticed this piece of code in Wordpress 2.9.1 (/wp-includes/compat.php), I don't understand it:
Has anyone ever modified the post-new.php file in their WordPress installation? I want to
PHP, as we all know is very loosely typed. The language does not require
PHP has a number of opcode caches, which as i understand it are scripts
Greetings: I am going to develop a basic Web site that supports some custom
I'm trying to make comments on my page just like the ones in wordpress.
I am a newbie to both PHP and Wordpress (but do ok in C#),
I've written a PHP script to access the latest item from the wordpress database,
Many popular applications such as Wordpress, WHMCS and the majority of PHP forums allow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.