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 8670655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:45:37+00:00 2026-06-12T18:45:37+00:00

teSo I’m trying to output a text and an image field from a duplicate

  • 0

teSo I’m trying to output a text and an image field from a duplicate group through Magic Fields, the text field shows the different duplicates but the image field keeps displaying the url to the first image repeatedly. Can anyone tell me what I’m doing wrong?

<?php
$articlephotos="&amp;w=728&amp;h=560&amp;q=95&amp;zc=1&amp;iar=0&amp;far=0";
?>

<?php $myContents = get_group('contents'); // use the Custom Group name
  foreach($myContents as $contents){ ?>

<?php  if( get('contents_text', true) ) { ?>
<div class="contents"><?php echo $contents['contents_text'][1]; ?></div>
<?php } ?>

<?php  if( get('contents_image', true) ) { ?>
<div class="post_container" style="padding-bottom: 24px;">
<div class="photo_outside">
<div class="photo_inside">
<img src="<?php bloginfo('stylesheet_directory'); ?>/phpThumb/phpThumb.php?src=<?php echo get_image('contents_image',$contents,$contents,0); ?><?php echo $articlephotos ?>" title="<?php echo get_the_title($ID) ?>" alt="<?php echo get_the_title($ID) ?>">
</div><!-- end photos_inside -->
</div><!-- end photos_outside -->
</div>
<?php } ?>

<?php } ?>

Thanks in advance!

EDIT: Var Dump outputs:

array(2) { [1]=> array(2) { [“contents_text”]=> array(1) { [1]=>
string(1085) “

Text 01

” } [“contents_image”]=> array(1) { [1]=> array(2) { [“original”]=>
string(122) “http://www.mysite.com/image01.jpg&#8221; [“thumb”]=>
string(122) “http://www.mysite.com/image01.jpg&#8221; } } } [2]=> array(2) {
[“contents_text”]=> array(1) { [1]=> string(1380) “

Text 02

” } [“contents_image”]=> array(1) { [1]=> array(2) { [“original”]=>
string(119) “http://www.mysite.com/image01.jpg&#8221; [“thumb”]=>
string(119) “http://www.mysite.com/image01.jpg&#8221; } } } }

I abbreviated the content of the texts and the image urls.

  • 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-06-12T18:45:38+00:00Added an answer on June 12, 2026 at 6:45 pm

    I found the solution from the plug-in’s group, thanks for your help!

    <?php $elements = get_group('contents');
    foreach($elements as $key => $element){                                      
    
    if( get('contents_text', true) ) {
        echo '<div class="contents">';
        echo $element['contents_text'][1];
        echo '</div>'; 
    }
    
    $images = get_order_field('contents_text',$key);
    foreach($images as $image){
    
    if( get('contents_image', $key ,$image = true) ) {
        echo '<div class="photo_outside"><div class="photo_inside">';
        echo '<img src="' . get('contents_image', $key ,$image) .'">';
        echo '</div></div>';
        }
    
    } } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why Cookies doesn't store information in php ? even in this simple code ..
I recently dived into LaTeX, starting with the help of a WYSIWYM editor like

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.