Posts on both home page and blog page
-
Hi ??
I love Tracks theme, but as I’m just “copy&paste” guy and I’m new to WordPress I can’t make WP work as I want.
I searched through forums and tried all solutions that I’ve found, but it’s always not exactly that.I’d like WP to display lists of post on both main page and blog, but on main page posts from 1 selectec category only.
First solution was setting static page in settings > reading.
As I left “Front Page” empty and “Post page” as blog, post were showing on both pages.
Then I tried to limit category on front page.
I used different vertions of code:function my_before_query( $query ) { if( $query->is_main_query() && is_front_page() ){ $query->set('cat', 10); } } add_action( 'pre_get_posts', 'my_before_query', 1 );
but it always effected not only front page, but blog too.
So, I tried different way.
In settings > reading “Front Page” as Home and “Post page” as blog.
On static Home I used Post-in-page plugin (https://www.ads-software.com/plugins/posts-in-page/) pulling post from selected category.
It’s working, but I lost list of post style used on blog page.At this point I’m not able to figure out what page should I use as Home templete.
Or what content-type *.php file change and how to change, to make it work as template.Please, help.
I’ve tried so many vertions of limiting main_query code that I don’t belive it will ever work.
So, is possible in Tracks to make template for static page making it look like dynamic front page with posts?Thank you very much!
- The topic ‘Posts on both home page and blog page’ is closed to new replies.