Skip to content

Commit

Permalink
Added current work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarst committed Dec 18, 2013
1 parent 04c6f31 commit 8f1d536
Show file tree
Hide file tree
Showing 6 changed files with 633 additions and 11 deletions.
1 change: 1 addition & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
</div> <!-- /#wrapper -->

</div><!-- /devhub-wrap -->
<?php
require WPORGPATH . 'footer.php';

55 changes: 53 additions & 2 deletions front-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,59 @@
<div class="pagebody">
<div class="wrapper">

<div style="margin: 3em 0 1em; color: #666; text-transform: uppercase; font-size: 15px; text-align: center">(As announced at WordCamp San Francisco 2013)</div>
<div style="margin: 1em 0 3em; font-size: 16px; text-align: center">Coming soon. In the meantime, <a href="http://codex.wordpress.org/">the Codex</a> is still pretty great.</div>
<div class="reference-landing">

<div class="search-guide section clear">
<h3><?php _e( 'Find what you need:', 'wporg' ); ?></h3>
<?php get_search_form(); ?>
</div><!-- /search-guide -->

<div class="topic-guide section">
<h4><?php _e( 'Or browse through topics:', 'wporg' ); ?></h4>
<ul class="unordered-list horizontal-list no-bullets">
<li><a href="<?php echo get_post_type_archive_link( 'wpapi-function' ) ?>"><?php _e( 'Functions', 'wporg' ); ?></a></li>
<li><a href="<?php echo get_post_type_archive_link( 'wpapi-hook' ) ?>"><?php _e( 'Hooks', 'wporg' ); ?></a></li>
<li><a href="<?php echo get_post_type_archive_link( 'wpapi-class' ) ?>"><?php _e( 'Classes', 'wporg' ); ?></a></li>
</ul>
</div><!-- /topic-guide -->

<div class="new-in-guide section clear">
<div class="widget box box-left">
<h3 class="widget-title"><?php $version = DevHub\get_current_version(); printf( __( 'New in %s:', 'wporg' ), $version->name ); ?></h3>
<ul class="unordered-list no-bullets">
<?php

$list = new WP_Query( array(
'posts_per_page' => 10,
'post_type' => array( 'wpapi-function', 'wpapi-hook', 'wpapi-class' ),
'orderby' => 'title',
'order' => 'ASC',
'tax_query' => array( array(
'taxonomy' => 'wpapi-since',
'field' => 'ids',
'terms' => $version->term_id,
) ),
) );

while ( $list->have_posts() ) : $list->the_post();

echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';

endwhile;
?>
</ul>
</div>
<div class="widget box box-right">
<h3 class="widget-title"><?php _e( 'APIs', 'wporg' ); ?></h3>
<ul class="unordered-list no-bullets">
<li><a href="#">Some API</a></li>
<li><a href="#">Some other API</a></li>
<li><a href="#">Another new API</a></li>
</ul>
</div>
</div><!-- /new-in-guide -->

</div><!-- /reference-landing -->

</div><!-- /wrapper -->
</div><!-- /pagebody -->
Expand Down
17 changes: 16 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

namespace DevHub;

add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' );
function theme_scripts_styles() {
wp_enqueue_style( 'wp-doc-style', get_stylesheet_uri() );
wp_enqueue_style( 'droid-sans-mono', '//fonts.googleapis.com/css?family=Droid+Sans+Mono' );
Expand Down Expand Up @@ -48,3 +49,17 @@ function wp_doc_comment( $comment, $args, $depth ) {
<?php
}

/**
* Get current (latest) since version
*
* @return object
*/
function get_current_version() {

$version = get_terms( 'wpapi-since', array(
'number' => '1',
'order' => 'DESC',
) );

return $version[0];
}
10 changes: 9 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
wp_enqueue_style( 'wporg-developer', get_bloginfo( 'stylesheet_url' ), array(), 1, 'screen' );
require WPORGPATH . 'header.php';
?>
<div class="devhub-wrap">

<div id="headline">
<div class="wrapper">
<h2><a href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h2>
<?php if ( is_post_type_archive() ) : ?>
<h2><a href="<?php $post_type = get_queried_object();
echo get_post_type_archive_link( $post_type->name ); ?>"><?php echo esc_html( $post_type->labels->name ); ?></a>
</h2>
<?php else : ?>
<h2><a href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h2>
<?php endif; ?>
</div>
</div>

Expand Down
4 changes: 3 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="wrapper">
<?php // get_template_part( 'breadcrumbs' ); ?>

<?php if ( have_posts() ) : the_post(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

Expand All @@ -16,7 +16,9 @@

<?php // comments_template( '/examples.php' ); ?>

<hr />
</article>
<?php endwhile; ?>

<?php else : ?>

Expand Down
Loading

0 comments on commit 8f1d536

Please sign in to comment.