• Resolved Uncle Twisty

    (@wienerbang)


    I’m trying to load a custom post type via a taxonomy (this is working) and when I load more it loads the correct post types yet ignores the custom fields (get_post_meta) for some reason.

    Here is my shortcode:

    <?php echo do_shortcode('[ajax_load_more post_type="artists" taxonomy="shows_attending" taxonomy_terms="'.$show.'" posts_per_page="9" scroll="false" orderby="name" button_label="Load More"]'); ?>

    wherein $show =

    $convention = get_post_meta(get_the_ID(), 'convention', true );
             $fuck = $convention[0]['choose-page-show'];

    My repeater looks like this

    <div class="span12 artist_container">
    <div class="artist_image span3">
       <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
    
       <?php if ( has_post_thumbnail() ) {
    the_post_thumbnail('thumbnail');
    } else { ?>
    <img src="http://www.villainarts.com/wp-content/uploads/2013/12/default.gif" alt="<?php the_title(); ?>" />
    <?php } ?>
    
       </a>
    </div>
    
    <div class="span6 artist_content">
    <h4 class="page-title" itemprop="headline"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h4>
    <h5>
    <?php $shop = get_post_meta( $post->ID, 'shop', true );
    if( !empty($shop) )
    foreach( $shop as $shop){
        echo $shop['shop'];
        echo '-';
    
    }?>	
    
    <?php $address = get_post_meta( $post->ID, 'address', true );
    if( !empty($address) )
    foreach( $address as $address){
        echo $address['line-2'];
    
    }?>
    </h5>
    
    <?php $website = get_post_meta( $post->ID, 'website', true );
    if( !empty($website) )
    foreach( $website as $website){
        echo '<a href="'. $website['website1'] .'" target="_blank">Website</a>';
    echo '-';
    }?>
    <?php $facebook = get_post_meta( $post->ID, 'facebook', true );
    if( !empty($facebook) )
    foreach( $facebook as $facebook){
        echo '<a href="'. $facebook['facebook1'] .'" target="_blank">Facebook</a>';
    echo '-';
    }?>	
    
     <?php $instagram = get_post_meta( $post->ID, 'instagram', true );
     if( !empty($instagram) )
    foreach( $instagram as $instagram){
        echo '<a href="'. $instagram['instagram1'] .'" target="_blank">Instagram</a>';
    
    }?>
     </div>
     <div class="span3">
     <b>Shows Attending</b>
     <?php $terms = wp_get_post_terms($post->ID,'shows_attending');
     $count = count($terms);
     if ( $count > 0 ){
         echo "<ul>";
         foreach ( $terms as $term ) {
           echo '<li>'. $term->name . "</a></li>";
    		 }
    		 echo "</ul>";
    	 }?>
    </div>

    basically it’s not loading anything but the title and the thumbnail, any help would be greatly appreciated.

    Thanks.
    https://wordpress.org/plugins/ajax-load-more/

Viewing 1 replies (of 1 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi.
    I believe this is because you need to define ‘global $post;’ at the opening of your repeater.

    See the last question on the FAQs.

    Cheers,

Viewing 1 replies (of 1 total)

The topic ‘Custom fields not loading in repeater’ is closed to new replies.