Hi Marissa,
Could be a few reasons.
- An issue with your repeater template (Can you post it?)
- Looks like you have a trailing comma in your array? You need to remove that
- Can you orderby post__in ? I don’t think so, but I could be wrong.
Cheers,
My template is a bit convoluted but here it is. I don’t think the trailing comma is the issue but I can certainly remove it.
I’m using advanced custom fields for the ordering so I’ll look into other ordering options.
<?php
if (empty($post->post_password)){ ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if(!is_home()){
if(get_field('project_image_override')){
$src = get_field('project_image_override');
}else{
$vid = get_field('featured_video_id');
$src = get_vimeo_thumb($vid, 'thumbnail_', '1200x420');
}
}else{
// if it's homepage serve the larger image
if(get_field('hero_image')){
$src = get_field('hero_image');
}else{
$vid = get_field('featured_video_id');
//$src = get_vimeo_thumb($vid, 'thumbnail_', '1200x710');
$src = get_vimeo_thumb($vid, 'thumbnail_', '1200x675');
}
}
?>
<img src="<?php echo $src; ?>" height="420" width="1200">
<header class="entry-header">
<div class="copy">
<?php $taxes = wp_get_post_terms(get_the_ID(), 'clients', array("fields" => "all"));
$clients = '';
foreach ($taxes as $tax) {
$clients.= $tax->name.', ';
}
$client = substr($clients, 0, -2);
?>
<h1 class="hasicon"><i class="ce-cross pink"></i><?php echo $client; ?></h1>
<?php the_title(); ?>
</div>
</header><!-- .entry-header -->
<a href="<?php the_permalink(); ?>"></a>
</li><!-- #post-## -->
<?php } ?>
Ok, looking at your template I think it is it the issue.
For testing, can you remove the php conditional?
As stated on the Repeater Templates page:
Tips and Tricks
Always open and close your templates with an HTML element. In some rare cases data may not be displayed if not wrapped in HTML.
e.g. <li> </li> or <div> </div>
I stripped it down to this:
<li>
<img src="http://placehold.it/1200x420" height="420" width="1200">
<header class="entry-header">
<?php the_title(); ?>
</header><!-- .entry-header -->
<a href="<?php the_permalink(); ?>"></a>
</li><!-- #post-## -->
and I’m still getting the duplication.
I actually stripped it down to just titles:
Artist to Watch | Ty Dolla $ign
Architect of the Future | Brand Film
Underworld, Inc | New Season Launch
Devious Maids | Custom Integration
Artist to Watch | Benjamin Booker
Devious Maids | Custom Integration
Underworld, Inc | New Season Launch
Dreamworks’ Home | Intergalactic Interview
Consistently Amazing | Keynote Address
Artist To Watch | Sam Smith
Blaze | Commerical
Halo Awards | Show Campaign
Laugh Your Butt Off | Brand Image Refresh
Team Umizoomi | App Spot
and you can see what I mean about random duplication
Ok,
Can you fix the trailing comma and the orderby parameter?
Other than that I’m not sure without having access to your site.
Cheers,
according to the codex you can do post__in
http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
‘post__in’ – Preserve post ID order given in the post__in array (available since Version 3.5)
I have removed the trailing comma. Still no luck.
Interesting!
But I still think that wont work because of the way the plugin build the wp_query in the background.
WP will likely require array(‘id’, ‘id’, ‘id’);
Anyways, can you give me access?
If so, you can use the contact form on the website.
somehow I got it to work. I changed what was being returned to just the ID since that’s all I needed anyway. Also that remove_all_filters seemed to help as well.
<?php
$works = get_field('work');
$allwork = implode(",", $works);
remove_all_filters('posts_orderby');
?>
<?php echo do_shortcode('[ajax_load_more preloaded="true" post_type="work" post__in="'.$allwork.'" button_label="Load More" orderby="post__in" transition="fade"]'); ?>