Robson.Pi
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Tracks] Posts on both home page and blog pageI’m sorry Marcin – I didn’t mean that I wrote the plugin.
As I wrote in first post I’m “copy&paste” guy.
I wouldn’t be able to write something like that.I should write that “I used” code of your plugin.
The truth is that I looked through so many posts about limiting the wp_query that I couldn’t find out who was the author of the code.Once againt – sorry for that.
And thank You for great plugin.Forum: Themes and Templates
In reply to: [Tracks] Posts on both home page and blog pageThanku you for you attantion!
I’m OK for now 🙂 & marking topic as resolved.Forum: Themes and Templates
In reply to: [Tracks] Posts on both home page and blog pageWhile cooking dinner I thought about another vertion of filtering main loop and made solution mostly by accident 🙂
It’s how it worked for me.In settings > reading “Front Page” as Home and “Post page” as blog.
I used Post-in-page plugin (https://ww.wp.xz.cn/plugins/posts-in-page/) pulling post from selected category on static Home.I also made plugin:
<?php /* Plugin Name: Limit homepage to display a single Category */ add_action('wp_head', 'iworks_only_one_category'); function iworks_only_one_category() { if ( is_front_page() ) { global $wp_query; $wp_query->query('cat=10'); } if ( is_home() ) { global $wp_query; $wp_query->query('cat=-10'); } } ?>After turning the plugin things work as I want.
I tried this plugin earlier, but when settings > reading “Front Page” was set as empty (no page was set) it didn’t work.