Support

Account

Forum Replies Created

  • +1

    Same issue in Preview.
    Gutenberg Editor.

  • Hi HQ80,

    thank you, this brought me a big step forward.

    I got all pages displayed that share a dropdown-field-value.
    Unfortunately now I’m struggling with the ordering.

    To be more concrete:
    – I got 6 pages that are part of a series
    – In the ACF-Template of these pages I have:
    — a dropdown for the series they belong to (dropdown field)
    — a dropdown for the prev page in the series (page field)
    — a dropdown for the next page in the series (page field)
    Image:
    Add Articles in Series

    As stated above I got all pages displayed that share a series.
    But for the ordering: How can I display in the correct order?

    My current code looks like this:

    <?php 
    			$posts = get_posts(array(
    				'posts_per_page'	=> -1,
    				'post_type'			=> 'page',
    				'meta_value'		=> 'series1',
    			));
    
    			if( $posts ): ?>
    				<ul class="list list--styled">
    				<?php foreach( $posts as $post ): 
    					setup_postdata( $post );
    					?>
    					<li>
    						<a href="<?php the_permalink(); ?>">
    						    <div><?php the_field('title_short'); ?></div>
    				    	</a>
    					</li>
    				<?php endforeach; ?>
    				</ul>
    				<?php wp_reset_postdata(); ?>
    			<?php endif; ?>
  • Any thoughts on this?
    Not sure how to solve this unfortunately.

  • Thanks. I found that snippet before. It returns 0 in my case.
    Not sure what I’m doing wrong:

    ...
    <?php elseif ( get_row_layout() == 'grid' ) : ?>
    
      <?php $count = count(get_field('grid_block')); ?>
      <?php echo $count; ?> // No matter where I place this, it returns 0
    
      <?php if ( have_rows( 'grid_block' ) ) : ?>
          <?php while ( have_rows( 'grid_block' ) ) : the_row(); ?>
            
            // if total number of rows > 1 do this for all rows...
            // elseif total number of rows > 2 do this for all rows...
            // elseif total number of rows > 3 do this for all rows...
    
          <?php endwhile; ?>
      <?php endif; ?>
    <?php endif; ?>
    ...
  • + 1 for an implementation of this in the UI.

    Especially for this:
    ‘field grows to fill content’

    Thanks for the suggestion.

Viewing 5 posts - 1 through 5 (of 5 total)