Tag Info

New answers tagged

1

Yes your code will fail, but not because the above answer, but because this isn't the page you ask for. As you wrote, you set the page "videos" to be the page where all the posts are shown. When a page is set as a blogpage, Wordpress will use home.php or index.php according to the template hierarchy to display the blogpage, not a page template. This page ...


0

Please note: I have misread the question and did not realise that the page is set as blogpage. I'm keeping this answer as extra information just to serve someone about pre_get_posts and page templates. I have added additional info to the upvoted answer about blogpage and is_home Your code will fail, as you have already discovered. pre_get_posts does not ...



Top 50 recent answers are included