Skip to content

Commit

Permalink
Added the featured image to search results
Browse files Browse the repository at this point in the history
Resolves #330.
  • Loading branch information
Misplon committed Jul 19, 2018
1 parent 5d92cf0 commit 4f967e8
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 14 deletions.
2 changes: 2 additions & 0 deletions sass/rtl/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
margin: 0 0 0 (-$size__site-sidebar);

@media (max-width: 600px) {

body.rtl.responsive & {
margin: 0 !important;
}
Expand All @@ -16,6 +17,7 @@
margin: 0 0 0 $size__site-sidebar;

@media (max-width: 600px) {

body.rtl.responsive & {
margin: 0 !important;
}
Expand Down
35 changes: 34 additions & 1 deletion sass/site/primary/_posts-and-pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,41 @@ article.page {
}
}


.page-links {
clear: both;
margin: 0 0 1.5em;
}

.search-results {

article.post {
clear: both;
margin-bottom: 35px;
overflow: auto;
}

.entry-title {
font-size: 18px;
}

.entry-thumbnail {
float: left;
margin: 0 20px 15px 0;
text-align: left;
width: 40%;

@media (max-width: 1024px) {
float: none;
text-align: center;
width: auto;
}
}

@at-root .page-layout-no-sidebar.search-results .entry-thumbnail {
width: 30%;

@media (max-width: 1024px) {
width: auto;
}
}
}
25 changes: 25 additions & 0 deletions style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 24 additions & 13 deletions template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,30 @@
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php siteorigin_north_post_meta(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->

<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->

<?php if ( has_post_thumbnail() && siteorigin_setting( 'blog_featured_archive' ) ) : ?>
<div class="entry-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
<?php endif; ?>

<div class="north-content-wrapper">
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php siteorigin_north_post_meta(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->

<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
</div>

</article><!-- #post-## -->

0 comments on commit 4f967e8

Please sign in to comment.