[Resolved] Custom result page and taxonomy

Home Forums Support [Resolved] Custom result page and taxonomy

Home Forums Support Custom result page and taxonomy

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #887054
    Tom
    Lead Developer
    Lead 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.

    #887083
    Cris

    Ok 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.

    #887131
    Tom
    Lead Developer
    Lead Developer

    Both 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;
    } );
    #887372
    Cris

    I use that but the result is not the same in both.
    Taxonomy / Search results

    Added 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;}

    #888073
    Tom
    Lead Developer
    Lead Developer

    There 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.

    #888141
    Cris

    Better now with your code! Thanks!
    I don’t need excerpt here. My biggest problem was the overflowing.
    Thank you very much!!

    #888347
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.