- This topic has 5 replies, 2 voices, and was last updated 2 years, 11 months ago by
David.
-
AuthorPosts
-
February 19, 2020 at 4:20 am #1170132
Michał
Hello,
I would like to make an effect on my website so that the results are displayed centered vertically and horizontally or in some boxes. Could this be achieved with CSS or functions?Now I have column but they don’t want to center horizontally.
February 19, 2020 at 6:30 am #1170253David
StaffCustomer SupportHi there,
can you try disabling the Masonry option in Customizer > Layout > Blog – then i can take a look if the elements still need aligning.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 19, 2020 at 7:59 am #1170547Michał
Ok I did it. But not using layout. I used the function:
function lh_custom_search_results_page_settings( $options ) {
if ( is_search() ) {
$options[‘read_more_button’] = true;
$options[‘date’] = false;
$options[‘categories’] = false;
$options[‘tags’] = false;
$options[‘comments’] = false;
$options[‘infinite_scroll’] = true;
$options[‘infinite_scroll_button’] = true;
$options[‘masonry_load_more’] = ‘Więcej wyników szukania’;
$options[‘post_image’] = true;
$options[‘post_image_position’] = ‘post-image-above-header’;
$options[‘post_image_alignment’] = ‘post-image-aligned-justify’;
$options[‘column_layout’] = true;
$options[‘featured_column’] = false;
$options[‘masonry’] = false;
}return $options;
}Because I wanted to have separate settings for the search page and separate for the blog.
I noticed that all photos must have the same dimension but with many items the proportion will be different. What’s more, the length of the text also affects the display of search results, which looks very bad. Some are above others below.
I am wondering if it is possible to close these items in boxes with a visible borderline and at the same time that this did not affect the blog’s settings?February 19, 2020 at 8:45 am #1170597David
StaffCustomer SupportTry this CSS:
.search.one-container:not(.page) .inside-article { border: 1px solid #ccc; padding: 10px; display: flex; flex-direction: column; } .search.one-container:not(.page) .inside-article .post-image { text-align: center; } .search.one-container:not(.page) .inside-article .post-image img { max-height: 200px; width: auto; } .search.one-container:not(.page) .entry-summary, .search.one-container:not(.page) .entry-title { margin-bottom: 1.5em; } .search.one-container:not(.page) .entry-summary { margin-top: auto; } .search.one-container:not(.page) .entry-summary ul { list-style: none; margin-left: 0 }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 19, 2020 at 9:40 am #1170659Michał
Works exactly as I wanted !! Thanks David!!
February 20, 2020 at 2:34 am #1171216David
StaffCustomer SupportGlad to be of help
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.