- This topic has 21 replies, 4 voices, and was last updated 4 years, 11 months ago by Tom.
-
AuthorPosts
-
May 2, 2019 at 12:46 pm #887054TomLead DeveloperLead Developer
Perfect. And what about the code isn’t working? It says in there that masonry, columns etc.. are set to false, so what I’m seeing looks pretty consistent with what your function is defining.
May 2, 2019 at 1:08 pm #887083CrisOk I’ll explain:
Look at the “search results” and “taxonomy” options. They are the same but the result they give is different.
See here search Results with this code:
/*Resultados búsquedas*/add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' ); 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'] = 'Ver más resultados'; $options['masonry_loading'] = 'Cargando más resultados'; $options['post_image'] = true; $options['post_image_position'] = 'post-image-above-header'; $options['post_image_alignment'] = 'post-image-aligned-center'; $options['column_layout'] = false; $options['featured_column'] = false; $options['masonry'] = false; } return $options; }
See here taxonomy page work with this code:
add_filter( 'option_generate_blog_settings', 'lh_custom_taxonomy_page_settings' ); function lh_custom_taxonomy_page_settings( $options ) { if ( is_tax() ) { $options['read_more_button'] = false; $options['infinite_scroll'] = true; $options['infinite_scroll_button'] = true; $options['masonry_load_more'] = 'Ver más resultados'; $options['masonry_loading'] = 'Cargando más resultados'; $options['post_image'] = true; $options['post_image_position'] = 'post-image-above-header'; $options['post_image_alignment'] = 'post-image-aligned-left'; $options['column_layout'] = false; $options['featured_column'] = false; $options['masonry'] = false; } return $options; }
In taxonomy if I change the options it do nothing. Only work this option: $options[‘post_image_alignment’] = ‘post-image-aligned-left’;
I need change the taxonomy page like/similar to the search result page.May 2, 2019 at 1:39 pm #887131TomLead DeveloperLead DeveloperBoth functions have different values, which is why the pages don’t look the same.
If you want them to look the same, perhaps just use one function?:
add_filter( 'option_generate_blog_settings', function( $options ) { if ( is_search() || is_tax() ) { $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'] = 'Ver más resultados'; $options['masonry_loading'] = 'Cargando más resultados'; $options['post_image'] = true; $options['post_image_position'] = 'post-image-above-header'; $options['post_image_alignment'] = 'post-image-aligned-center'; $options['column_layout'] = false; $options['featured_column'] = false; $options['masonry'] = false; } return $options; } );
May 2, 2019 at 10:52 pm #887372CrisI use that but the result is not the same in both.
Taxonomy / Search resultsAdded both same CSS code:
/*Search-results and Tax-pais*/
.search-results, .tax-pais {background-color:#f4f4f4;}
.search .post-image, .tax-pais .post-image {float:left; height:200px; width:300px;overflow:hidden;object-fit:cover;margin:0 40px 50px 0;}
.search .entry-title, .tax-pais .entry-title {font-size:24px !important;}May 3, 2019 at 8:51 am #888073TomLead DeveloperLead DeveloperThere are no excerpts in the taxonomy. You might need to add a manual excerpt for it to show up, depending on how you’ve added the content. That’s why there isn’t a read more button either.
You can stop the images from overflowing with this CSS:
.tax-pais .entry-summary { min-height: 100px; }
Other than that the two look the same for me.
May 3, 2019 at 9:54 am #888141CrisBetter now with your code! Thanks!
I don’t need excerpt here. My biggest problem was the overflowing.
Thank you very much!!May 3, 2019 at 2:33 pm #888347TomLead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.