Skip to content

Commit

Permalink
improved coding of template files and search form
Browse files Browse the repository at this point in the history
  • Loading branch information
Netzberufler committed Jun 18, 2016
1 parent 6e79bf4 commit dd8ee9b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
8 changes: 6 additions & 2 deletions searchform.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@

<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label>
<span class="screen-reader-text"><?php _ex( 'Search for:', 'label', 'gridbox' ); ?></span>
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'gridbox' ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s">
<span class="screen-reader-text"><?php echo esc_html_x( 'Search for:', 'label', 'gridbox' ); ?></span>
<input type="search" class="search-field"
placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'gridbox' ); ?>"
value="<?php echo esc_html( get_search_query() ); ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label', 'gridbox' ); ?>" />
</label>
<button type="submit" class="search-submit">
<span class="genericon-search"></span>
<span class="screen-reader-text"><?php echo esc_html_x( 'Search', 'submit button', 'gridbox' ); ?></span>
</button>
</form>
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ textarea {
background: #4477aa;
}

/* Page Links | wp_link_pages() */
/* Page Links */
.page-links {
margin: 0;
word-spacing: 1em;
Expand Down
2 changes: 1 addition & 1 deletion template-parts/content-featured.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

<a href="<?php esc_url( the_permalink() ); ?>" class="featured-image-link">
<a href="<?php the_permalink(); ?>" class="featured-image-link">

<?php // Display Post Thumbnail or default thumbnail.
if ( has_post_thumbnail() ) :
Expand Down
9 changes: 7 additions & 2 deletions template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
<?php gridbox_post_image_single(); ?>

<div class="entry-content clearfix">

<?php the_content(); ?>
<!-- <?php trackback_rdf(); ?> -->
<div class="page-links"><?php wp_link_pages(); ?></div>

<?php wp_link_pages( array(
'before' => '<div class="page-links"><p>' . esc_html__( 'Pages:', 'gridbox' ),
'after' => '</p></div>',
) ); ?>

</div><!-- .entry-content -->

</article>
2 changes: 1 addition & 1 deletion template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

<a href="<?php esc_url( the_permalink() ); ?>" rel="bookmark">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_post_thumbnail(); ?>
</a>

Expand Down
9 changes: 7 additions & 2 deletions template-parts/content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@
</header><!-- .entry-header -->

<div class="entry-content clearfix">

<?php the_content(); ?>
<!-- <?php trackback_rdf(); ?> -->
<div class="page-links"><?php wp_link_pages(); ?></div>

<?php wp_link_pages( array(
'before' => '<div class="page-links"><p>' . esc_html__( 'Pages:', 'gridbox' ),
'after' => '</p></div>',
) ); ?>

</div><!-- .entry-content -->

<footer class="entry-footer">
Expand Down
2 changes: 1 addition & 1 deletion template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

<a href="<?php esc_url( the_permalink() ); ?>" rel="bookmark">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_post_thumbnail(); ?>
</a>

Expand Down

0 comments on commit dd8ee9b

Please sign in to comment.