- This topic has 1 reply, 2 voices, and was last updated 7 years, 5 months ago by Hash.
- AuthorPosts
- December 13, 2016 at 1:25 am #1364MinvooParticipant
Hi. I have many categories on my site for example:
news – you can see it on main page
culture – culture category
sport – sport category
etc.I’ve added simple line of code to functions.php to see only news (id=4) category on main page which is:
function only_one_category() { if ( is_home() || is_front_page() ) { global $wp_query; $wp_query->query('cat=4'); }
The problem is when I have many posts on main page. The site automatically creates page 2,3,4 etc. It’s fine, but it works fine for category pages. On main page when I enter to /page/2/, my posts don’t change. I have the same posts like on /page/1/ or /page/3/ etc..
Can you tell me how can I fix this or when can I find code which is responsible for doing next pages for main page?
Maybe you know other trick to show only one category on main page which will not damage the site ?December 23, 2016 at 12:01 am #1456HashKeymasterHi,
The Square theme does not have feature to show the blog post in the front page. Can you please let us know your website url?
- AuthorPosts
- You must be logged in to reply to this topic.