- This topic has 4 replies, 3 voices, and was last updated 3 years, 12 months ago by
Tom.
-
AuthorPosts
-
February 26, 2017 at 1:48 pm #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.44GP Premium 1.2.94February 26, 2017 at 1:59 pm #284287Leo
StaffCustomer SupportHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 26, 2017 at 11:07 pm #284391Tom
Lead DeveloperLead DeveloperYou 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 useis_category( 'Category Name' )
or whatever.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 27, 2017 at 8:44 am #284569tux
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!
February 27, 2017 at 10:12 am #284644Tom
Lead DeveloperLead DeveloperLooks 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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.