Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mattfrieder

    (@mattfrieder)

    Awesome @seindal , thats a great idea. I’ll definitely take a look, thanks!

    Thread Starter mattfrieder

    (@mattfrieder)

    Thank you @anlino !

    For anyone looking to create similar, I achieved it with this custom code block in singular.php, between the ‘page-header’ and ‘content’:

    <!-- Display posts if page name is "Featured Work" -->
    <?php if ( is_page( "Featured Work" ) ) : ?>
    
      <div class="posts" id="posts">
    
        <?php $postslist = get_posts( array(
          'order'          => 'ASC',
          'orderby'        => 'rand',
          // Display posts only in certain category option:
          // 'category_name'  =>	'category-slug'
        ) );
    
        if ( $postslist ) {
          foreach ( $postslist as $post ) :
            setup_postdata( $post );
    
            get_template_part( 'content' );
    
          endforeach;
        wp_reset_postdata();
      } ?>
    
    <?php endif; ?>
    
    </div> <!-- .posts -->
    • This reply was modified 4 years, 6 months ago by mattfrieder.
Viewing 2 replies - 1 through 2 (of 2 total)