Title: Multiple magic fields on same page causing double posts
Last modified: August 22, 2016

---

# Multiple magic fields on same page causing double posts

 *  [garydos34](https://wordpress.org/support/users/garydos34/)
 * (@garydos34)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multiple-magic-fields-on-same-page-causing-double-posts/)
 * I am using Magic Fields to create categorized image galleries. I have created
   3 different custom fields (port_thumb, illustration_thumb, photo_thumb) so that
   I can post my thumbnail image to one of 3 different sections. Is there something
   I can do to keep each post separate to its designated field? Essentially what
   happens when I create a post for say ‘port_thumb,’ the thumbnail image loads 
   up and everything is fine in that section. But then lower on the page in both
   of the other 2 sections an invisible link for the port_thumb shows up as well
   as loading in the css for that section. Is there some code I can add to prevent
   each post from showing up 3 times on the page?
 * ‘<?php get_header();
    /*Template Name: Portfolio*/ ?>
 * <div id=”main”>
 * <!–TYPOGRAPHY–>
    <div class=”typography”> <div class=”title1″> </div>
    -  <?php query_posts( ‘category_name=portfolio’ ); ?>
       <?php if (have_posts()):?
      >
    -  <?php while (have_posts()) : the_post(); ?>
    -  ” rel=”bookmark”
       title=”Permanent Link to <?php //the_title_attribute();?
      >”>
    - <?php echo get_image(‘port_thumb’);?>
    -  <?php endwhile; ?>
       <?php //next_posts_link(‘Older Entries’) ?> <?php //previous_posts_link(‘
      Newer Entries’) ?>
    - <?php else : ?>
    - <?php endif; ?>
 *  <!–end typography–>
    </div>
 *  <!—— BEGIN ILLUSTRATION–>
    <div class=”illustration”> <div class=”title2″> </
   div>
    -  <?php query_posts( ‘category_name=portfolio’ ); ?>
       <?php if (have_posts()):?
      >
    -  <?php while (have_posts()) : the_post(); ?>
       ” rel=”bookmark” title=”Permanent
      Link to <?php the_title_attribute(); ?>”>
    - <?php echo get_image(‘illustration_thumb’);?>
    -  <?php endwhile; ?>
       <?php //next_posts_link(‘Older Entries’) ?> <?php //previous_posts_link(‘
      Newer Entries’) ?>
    - <?php else : ?>
    - <?php endif; ?>
 *  <!–end ILLUSTRATION–>
    </div>
 *  <!— PHOTOGRAPHY—>
    <div class=”photography”> <div class=”title3″> </div>
    -  <?php query_posts( ‘category_name=portfolio’ ); ?>
       <?php if (have_posts()):?
      >
    -  <?php while (have_posts()) : the_post(); ?>
       ” rel=”bookmark” title=”Permanent
      Link to <?php the_title_attribute(); ?>”>
    - <?php echo get_image(‘photo_thumb’);?>
    -  <?php endwhile; ?>
       <?php //next_posts_link(‘Older Entries’) ?> <?php //previous_posts_link(‘
      Newer Entries’) ?>
    - <?php else : ?>
    - <?php endif; ?>
 *  <!–end image–>
    </div>
 *  <!–end main–>
    </div>
 * <!–content end–>’

The topic ‘Multiple magic fields on same page causing double posts’ is closed to
new replies.

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [garydos34](https://wordpress.org/support/users/garydos34/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/multiple-magic-fields-on-same-page-causing-double-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
