Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq1988 committed Jan 22, 2014
0 parents commit e53fd6b
Show file tree
Hide file tree
Showing 164 changed files with 22,721 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 404.php
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php get_template_part( 'templates/page', 'header' ); ?>

<div class="alert alert-warning">
<?php _e( 'Sorry, but the page you were trying to view does not exist.', 'roots' ); ?>
</div>

<p><?php _e( 'It looks like this was the result of either:', 'roots' ); ?></p>
<ul>
<li><?php _e( 'a mistyped address', 'roots' ); ?></li>
<li><?php _e( 'an out-of-date link', 'roots' ); ?></li>
</ul>

<?php get_search_form(); ?>
49 changes: 49 additions & 0 deletions archive.php
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
$parent_cat = get_queried_object();
$categories = get_terms( 'category', array('hide_empty' => false, 'orderby' => 'term_id', 'parent' => $parent_cat->term_id) );

if ( $categories ) {
printf( '<h2 class="category-title">%s</h2>', $parent_cat->name );

echo '<ul class="doc-category clearfix">';
foreach ( $categories as $category ) {
include 'templates/loop-category.php';
}
echo '</ul>';
}

// WP_Query arguments
$args = array(
'post_type' => 'post',
'category__in' => array( $parent_cat->term_id ),
'posts_per_page' => -1
);

// The Query
$doc_query = new WP_Query( $args );

// The Loop
if ( $doc_query->have_posts() ) {

printf( '<h2 class="category-title">%s</h2>', __( 'Documents', 'wedevs-docs' ) );

echo '<ul class="doc-category">';
while ($doc_query->have_posts()) {
$doc_query->the_post();

get_template_part( 'templates/loop-content' );
}
echo '</ul>';
} else {
// no posts found
}

// Restore original Post Data
wp_reset_postdata();
?>

<?php if ( !$categories && !$doc_query->have_posts() ) { ?>
<div class="alert alert-warning">
<?php _e( 'Nothing found!', 'wedevs-docs' ); ?>
</div>
<?php } ?>
Loading

0 comments on commit e53fd6b

Please sign in to comment.