Site logo

Archived topic

Can't seem to limit the total number of posts on the homepage

3 replies · Started by Victor on February 16, 2022

Viewing posts 1–4 of 4

I have set it to 5 maximum posts under the settings. Tried clearing the cache. Disabled all Non-GP plugins to fault find but change. Can you help me fix this?

Hi Victor,

We may have to check if there's a PHP snippet or a plugin that's conflicting w/ the query of for your Home page.

Can you try disabling ALL plugins except GP premium and deactivate any child theme as well?

Also, If you've edited the parent theme's functions.php to add PHP snipepts, can you comment out the codes you've added? Let us know. :)

I am adding the two PHP snippets I have added using the Code Snippets plugin that is currently active on the site. I don't have a child theme. I did try disabling everything except GP premium and checking, but to no avail.

//This code removes noreferrer from your new or updated posts
function im_targeted_link_rel($rel_values) {
return 'noopener';
}
add_filter('wp_targeted_link_rel', 'im_targeted_link_rel',999);

//remove noreferrer on the frontend, but will still show in the editor
function im_formatter($content) {
$replace = array(" noreferrer" => "" ,"noreferrer " => "");
$new_content = strtr($content, $replace);
return $new_content;
}
add_filter('the_content', 'im_formatter', 999);
add_filter( 'generate_post_date_output', function( $output, $time_string ) {
    $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';

    if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
        $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated on: %4$s</time>';
    }

    $time_string = sprintf( $time_string,
        esc_attr( get_the_date( 'c' ) ),
        esc_html( get_the_date() ),
        esc_attr( get_the_modified_date( 'c' ) ),
        esc_html( get_the_modified_date() )
    );

    return sprintf( '<span class="posted-on">%s</span> ',
        $time_string
    );
}, 10, 2 );

Can you have the site cloned to a staging site (with ALL plugins disabled except GPP) and let us have temporary backend access?

Another angle to check would be:
Try checking if the host has some sort of object caching and page caching issue.

Object caching can cache queries so that may need clearing/disabling if there is one so the correct/updated query gets applied. :)

This archived topic is closed to new replies.