Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter RETALI8

    (@aaronviii)

    Did I mention I’m still learning php -.-‘

    Fixed:

    <?php
    // args
    $args = array(
    	'numberposts' => -1,
    	'post_type' => 'releases',
    	'meta_key' => 'whether-release',
    	'meta_value' => 'outnow',
    	'order' => 'ASC'
    );
    $the_query = new WP_Query( $args );
    ?>
    
    <?php if( $the_query->have_posts() ): ?>
    		<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    Thread Starter RETALI8

    (@aaronviii)

    I ended up using

    <?php query_posts('category_name=featured&posts_per_page=3'); //only display featured posts

    In the loop on the homepage.
    By categorising a post as ‘featured’ it will display in the loop on the homepage as well as well as in the feed of the regular ‘blog’ section. To avoid the slug of the permalink being marked featured, I assign the category of ‘featured’ after choosing the category it should appear in.

    Not sure if it’s necessarily the most elegant solution, however It works for the purpose of this particular theme.

    Thread Starter RETALI8

    (@aaronviii)

    In case anybody else has this same problem later, I fixed it

    <?php
          $number_recents_posts = 3;
         $args=array('numberposts' => $number_recents_posts,'post_status'=>'publish');
    
          $recent_posts = wp_get_recent_posts( $args );
          foreach($recent_posts as $post){
            echo '<li><a href="' . get_permalink($post["ID"]) . '" title="Look '.$post["post_title"].'" >' .   $post["post_title"].'</a> <hr class="skinnydivider" /></li> ';
          } ?>
Viewing 3 replies - 1 through 3 (of 3 total)