Support

Account

Home Forums Add-ons Flexible Content Field Include flexible content on Woocommerce product category page

Unread

Include flexible content on Woocommerce product category page

  • The following code works for displaying flexible content on standard wordpress posts/pages, but doesn’t show anything for woocommerce product archive pages.

    <?php 
    
    	// Check page_blocks exists.
    	if( have_rows('page_blocks') ):
    
    		echo '<div class="blockContent">';
    
    		// Loop through page_blocks rows.
    		while ( have_rows('page_blocks') ) : the_row();
    	
    			// check text row layout
    			if( get_row_layout() == 'plain_text' ):
    
    				while( have_rows('plain_text_group') ): the_row();
    
    					$background_colour 	= get_sub_field('background_colour');
    					$spacing_before 	= get_sub_field('spacing_before');
    					$padding_before 	= get_sub_field('padding_before');
    					$text_alignment 	= get_sub_field('text_alignment');
    					$max_width 			= get_sub_field('max_width');
    					
    					$plain_text 		= get_sub_field('plain_text');
    
    				endwhile;
    
    				if($plain_text):
    					//Do something with the plain text
    				endif; //if( $plain_text )
    
    			endif; //if( get_row_layout() == 'plain_text' )
    
    			// End loop.
    		endwhile; // while have_rows('page_blocks')
    
    		echo '</div><!--/.blockContent-->';
    
    	endif; // if have_rows('page_blocks')
    
    ?>

    Is there something obvious I’m missing?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.