[Support request] Two blogs – Masonry and "normal"

Home Forums Support Two blogs – Masonry and "normal"

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #284286
    tux

    Hi!

    I’d really like to add an additional blog with the “common layout” to my already existing masonry/tiles blog. How is this possible?

    And I`d really like to add a filter to my masonry blog, so that just the blog entries connected to a certain “topic” will show up. What would be the best way to do this?

    Thank you in advance!

    GeneratePress 1.3.44
    GP Premium 1.2.94
    #284287
    Leo
    Staff
    Customer Support

    Hi there,

    I think the easiest way is to use Tom’s WP Show Posts plugin 🙂
    https://en-ca.wordpress.org/plugins/wp-show-posts/

    It should be able to do all those things.

    Let me know.

    #284391
    Tom
    Lead Developer
    Lead Developer

    You can turn off masonry by default, then enable it within certain conditions: https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-masonry-to-your-custom-post-type

    So instead of is_post_type_archive( 'portfolio' ) you could use is_category( 'Category Name' ) or whatever.

    #284569
    tux

    So, let me clarify as I think I wasn’t quite good in explaining what I’d like to do. Sorry, it’s still difficult to explain these kind of things in a foreign language.

    My front page is set to display recent posts. I want the front page to show all my posts connected to the category “front-page” in masonry style.

    Then there is a second site, let’s call it “Blog” which I’d like to show posts connected to the category “blog” – neither in the column-style, nor in the masonry style.

    I used your linked example with “is_front_page() && is_home()” as condition. Now the front page is in masonry – perfect!

    I found a snippet which I think would be necessary. It filters out all the entries which should only show up on the “Blog”

    add_action( 'pre_get_posts', 'my_home_category' );
    function my_home_category( $query ) { 
        if ( $query->is_front_page() && $query->is_main_query() ) { 
            $query->set( 'cat', '1'); 
        } 
    }

    Now, I just need to “activate” a feature, so that the “Blog” site show my posts too, instead of just the front page. I think I could apply the same code as inserted above to filter out the posts which should only show up on the other site.

    Thank you again for your awesome help!

    #284644
    Tom
    Lead Developer
    Lead Developer

    Looks like you’re pretty much there!

    For the “Blog” site, you could just use the built in category template?

    Let me know if that doesn’t work for you 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.