RETALI8
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: Reverse post order with 2 loops on a pageDid 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(); ?>Forum: Themes and Templates
In reply to: Creating 'Featured posts' with loop and custom post typeI ended up using
<?php query_posts('category_name=featured&posts_per_page=3'); //only display featured postsIn 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.
Forum: Themes and Templates
In reply to: Draft posts showing up in 'recent posts' feedIn 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)