Forum Replies Created

  • Ok fixed it myself


    So i have had a look around on the documentation and tried a few things in which im half successful

    I used the_sub_field(sub_field_name) which outputs all of the rows but they output like an array would do, just all text and it displays in one big chunk above everything and if i change it to get_sub_field it only pulls in one row for each post but displays correctly

    here is the updated code

    function my_custom_giveaways($content){
    	$giveawayQuery = new WP_Query(array(
    		'post_type' => 'giveaways'
    	global $post;		  
    	$giveawayResult = '<div class="cgBox">';
    	$giveawayResult .= '<div class="cgBox-inner">';
    	$giveawayResult .= '<div class="cgBox-wrapper cgBoxes">';
    		  if ( $giveawayQuery->have_posts() ) : while ( $giveawayQuery->have_posts() ) : $giveawayQuery->the_post();
    		  $theID = $post->ID;
    		  if ( have_rows('my_giveaways') ) : while ( have_rows('my_giveaways') ) : the_row();
    		  	$giveawayBoxes = '<tr>
    						<td class="iconMid"><img src="' . the_sub_field('prize_icon') . '" width="25" height="25" alt=""></td>
    						<td class="thePrize">' . the_sub_field('place') . '<br>' . the_sub_field('prizes') . '</td>
Viewing 2 posts - 1 through 2 (of 2 total)