Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Restrict News Archive posts to archive category
  • Loading branch information
szk11001 committed May 15, 2015
1 parent bbb142d commit bccd69b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions.php
Expand Up @@ -452,6 +452,7 @@ function ajax_clas_search_archive() { //Retieves posts of a specific category or
$args = array(
's' => $search,
'fields' => 'ids',
'category_name' => 'archive'
);
$archiveQuery = new WP_Query( $args );
$archivePosts = $archiveQuery->get_posts();
Expand Down
2 changes: 2 additions & 0 deletions page-news-archive.php
Expand Up @@ -87,6 +87,7 @@ get_header(); ?>
<strong><p>News Stories</p></strong>
<ul class="news-archive-list">
<?php
$args = array( 'posts_per_page' => -1, 'category_name' => 'archive' );
$myposts = get_posts( $args );
for ($i=0; $i < 9; $i++) {
next($myposts);
Expand All @@ -113,6 +114,7 @@ get_header(); ?>
</div>

<?php
$args = array( 'numberposts'=> 10, 'orderby' => 'post-date', 'category_name' => 'archive');
$latestpost = get_posts( $args );

?>
Expand Down

0 comments on commit bccd69b

Please sign in to comment.