mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 01:01:18 +03:00
Add pledge sorting markup
This commit is contained in:
parent
2ad4b5c1e0
commit
5d6cb25232
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace WordPressdotorg\Five_for_the_Future\Theme;
|
||||
|
||||
use const WordPressDotOrg\FiveForTheFuture\Pledge\CPT_ID;
|
||||
|
||||
// If we don't have any posts to display for the archive, then send a 404 status. See #meta4151.
|
||||
if ( ! have_posts() ) {
|
||||
status_header( 404 );
|
||||
|
@ -15,10 +17,30 @@ get_header(); ?>
|
|||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<header class="page-header">
|
||||
<?php
|
||||
the_archive_title( '<h1 class="page-title">', '</h1>' );
|
||||
the_archive_description( '<div class="taxonomy-description">', '</div>' );
|
||||
?>
|
||||
<h1 class="page-title"><?php esc_html_e( 'Pledges', 'wordpressorg' ); ?></h1>
|
||||
<a href="/for-organizations/" class="button"><?php esc_html_e( 'Pledge your company', 'wordpressorg' ); ?></a>
|
||||
|
||||
<div class="page-header-controls">
|
||||
<form method="get" action="<?php echo esc_url( get_post_type_archive_link( CPT_ID ) ); ?>">
|
||||
<label for="pledge-sort"><?php esc_html_e( 'Sort pledges by', 'wordpressorg' ); ?></label>
|
||||
<select id="pledge-sort" name="order">
|
||||
<option value="" <?php selected( $_GET['order'], '' ); ?>>
|
||||
<?php esc_html_e( 'All Pledges', 'wordpressorg' ); ?>
|
||||
</option>
|
||||
<option value="alphabetical" <?php selected( $_GET['order'], 'alphabetical' ); ?>>
|
||||
<?php esc_html_e( 'Alphabetical', 'wordpressorg' ); ?>
|
||||
</option>
|
||||
<option value="contributors" <?php selected( $_GET['order'], 'contributors' ); ?>>
|
||||
<?php esc_html_e( 'Total Contributors', 'wordpressorg' ); ?>
|
||||
</option>
|
||||
</select>
|
||||
<span class="screen-reader-text">
|
||||
<input type="submit" />
|
||||
</span>
|
||||
</form>
|
||||
|
||||
<?php get_search_form(); ?>
|
||||
</div>
|
||||
</header><!-- .page-header -->
|
||||
|
||||
<?php
|
||||
|
|
Loading…
Reference in a new issue