[Resolved] Blog vs. WooCommerce conflict again?

Home Forums Support [Resolved] Blog vs. WooCommerce conflict again?

Home Forums Support Blog vs. WooCommerce conflict again?

  • This topic has 23 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #532651
    Tom
    Lead Developer
    Lead Developer

    Sounds good, Peter! Glad I could help πŸ™‚

    #533002
    Peter Duggan

    Well, this works (appended to my ‘child’ functions.php) for the other thing I wanted:

    add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
    function tu_search_column_count( $count ) {
        if ( is_search() ) {
            return 100;
        }
    
        return $count;
    }

    Maybe not the best or only way (?), but it’s the one I’ve got to work!

    #533218
    Tom
    Lead Developer
    Lead Developer

    That would set the width of the posts to 100%.

    #533319
    Peter Duggan

    It sets the width of the search results to 100% but leaves the Blog home page post summaries in columns and Masonry layout, which is what I wanted.

    #534046
    Tom
    Lead Developer
    Lead Developer

    Ah, you could probably just do this then:

    add_filter( 'generate_blog_columns', 'tu_disable_search_columns' );
    function tu_disable_search_columns( $columns ) {
        if ( is_search() ) {
            return false;
        }
    
        return $columns;
    }
    #534068
    Peter Duggan

    Yes, that works too. I just found the other way first, acknowledging ‘Maybe not the best or only way’. If the new way’s preferable/more elegant, I’ll keep it. πŸ™‚

    #534073
    Tom
    Lead Developer
    Lead Developer

    The way I provided will prevent all of the columns code from loading, so it’s a little lighter πŸ™‚

    #534080
    Peter Duggan

    Perfect, Tom… thanks again! πŸ™‚

    #534566
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! πŸ™‚

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