Navigation überspringen

[Geschlossen] Astra Theme override archive's "Display items per page" for pagination

This support ticket is created vor 1 Jahr, 4 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Nigel vor 1 Jahr, 4 Monaten.

Author
Artikel
#2679145

Hi, I've a couple of taxonomy archives with pagination. I've set 8 results per page, but it doesn't work.

The value is overridden by Astra Theme Customizing>Blog / Archive>Post Per Page setting.

It is a problem if I want to display a different number of result for the blog or other taxonomies.

Can you check it here:

/discover/antiquities-prehistoric-sites/
/wp-admin/admin.php?page=view-archives-editor&view_id=412

thanks
Umberto

#2679430

Nigel
Unterstützer

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+01:00)

Hi Umberto

It appears Astra applies its pagination settings later than Toolset, thereby overriding them.

You will need to use code to disable the application of the Astra setting on the archives that you specify.

Here's a simple example to dis-apply the Astra settings on the 'event' post type archive:

/**
 * Remove Astra archive pagination setting for specified archive
 */
add_action( 'parse_tax_query', 'ts_mod_archive_pagination', 1, 1 );
function ts_mod_archive_pagination( $query ){
	
	if ( ! is_admin() && $query->is_main_query() ) {

		// Check if it is the archive page for the 'event' post type
        if ( $query->is_post_type_archive( 'event' ) ) {

            remove_action( 'parse_tax_query', 'astra_blog_post_per_page', 10, 1 );
        }
    }
}

You'll need to modify that to test for the particular archives this should apply to.

Das Thema „[Geschlossen] Astra Theme override archive's "Display items per page" for pagination“ ist für neue Antworten geschlossen.