Forum Replies Created
-
Thanks Kenneth, that worked a treat. Changing the “20” to a “75” gave me just what I wanted.
Cheers mate,
Mango
Re-saving the Permalink settings solved the problem, and infinite scroll is working great now. I should have thought of that.
Thanks so much for your usual great support.
Mike
Hi Prasanna, yes you are correct. All good now, Thanks.
Mango
Greetings Prasanna, thank you, that worked well when added to Custom CSS in Graphene Options.
Interestingly I tried adding it instead to style.css on the Child Theme but that didn’t work for some reason.
Thanks again,
Mango
Thanks for your reply Kenneth and Salam. Yes I have thought of doing similar things to what you are both suggesting but I live in fear of being penalized by the Search Engines.
It’s a shame the theme doesn’t take care of it in some way. It sort of defeats the purpose of having a custom header.
Thanks again for your suggestions.
Mango.
Can someone tell me how to add a <h1> tag to my Home Page if I have disabled it in the Header section so that I can use my own banner.
Thanks
Mango.
Good morning Prasanna,
This code works in limiting the Posts on the Home Page to 1, but of course it also limits Category queries to 1 and as such is unusable for my purpose. For some reason the Home Page thinks that it is a Category?
<?php
function number_of_posts_on_archive($query){
if ($query->is_category) {
$query->set('posts_per_page', 1);
}
return $query;
}
add_filter('pre_get_posts', 'number_of_posts_on_archive');
?>Regards,
Mango
Still the same unfortunately Prasanna. Whatever number is set in the functions.php code, in this case 3, determines the number of Posts on the Home Page and Archive Pages.
For example if I change functions.php posts per page number to 2 then 2 Posts will be displayed on Home and Archive Pages.
Thanks for trying.
Hi Prasanna,
I have tried those settings, Reading Settings = 1, and function.php using your code results in 3 Posts in Archive and on Home Page. It appears that whatever is specified in the Child Theme functions.php overrides Reading Settings.
It seems not possible to do this.
Thank you for trying to help.
Mango
Greetings Prasanna,
Thank you for your reply. My Graphene Child functions.php now looks like this:
<?php
function number_of_posts_on_archive($query){
if ($query->is_home) {
$query->set('posts_per_page', 1);
}
return $query;
}
add_filter('pre_get_posts', 'number_of_posts_on_archive');
?>However I still get the default number of Posts (3) on Home page?
Can you think what I am doing wrong?
I am using Graphene 1.82
Thanking you,
Mango
