Making WordPress.org

Changeset 743


Ignore:
Timestamp:
07/09/2014 06:52:50 PM (8 years ago)
Author:
coffee2code
Message:

Code Reference: add search summary info to top of search results page

props melchoyce.
see #450.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss

    r742 r743  
    611611            overflow: auto;
    612612        }
     613    }
     614
     615    .search-results-summary {
     616        font-style: italic;
     617        margin-bottom: 1em;
    613618    }
    614619
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/searchform.php

    r742 r743  
    77?>
    88<div class="search-section section clear">
     9
     10<?php if ( is_search() ) { ?>
     11
     12    <div class="search-results-summary"><?php
     13    $count = (int) $GLOBALS['wp_query']->found_posts;
     14
     15    if ( $count ) {
     16        if ( is_paged() ) {
     17            $start = get_query_var( 'posts_per_page' ) * ( get_query_var( 'paged' ) - 1 );
     18        } else {
     19            $start = 0;
     20        }
     21        $end = min( $count, $start + get_query_var( 'posts_per_page' ) );
     22        printf(
     23            _n( '<strong>%d</strong> result found for "<strong>%s</strong>".', '<strong>%d</strong> results found for "<strong>%s</strong>". Showing results %d to %d.', $count, 'wporg' ),
     24            $count,
     25            esc_html( get_search_query() ),
     26            $start + 1,
     27            $end
     28        );
     29    } else {
     30        printf( __( '<strong>%d</strong> results found for "<strong>%s</strong>".', 'wporg' ), $count, esc_html( get_search_query() ) );
     31    }
     32    ?></div>
     33
     34<?php } ?>
    935
    1036    <form role="search" method="get" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css

    r742 r743  
    855855  overflow: auto;
    856856}
     857.devhub-wrap .search-results-summary {
     858  font-style: italic;
     859  margin-bottom: 1em;
     860}
    857861.devhub-wrap .reference-landing {
    858862  padding: 1em 0;
Note: See TracChangeset for help on using the changeset viewer.