Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter omeld

    (@omeld)

    Hi @anastas10s!

    Thanks for your reply. The site (www.ludliteratura.si) is quite complex so it wouldn’t be possible to change the theme globally as there are many templates unrelated to the store. If I understand correctly, I can’t use a separate theme for the store (multisite might work for that but I don’t think it’s currently an option).

    So how should I go about editing the templates? I mean, how do I edit the actual html layout?

    But in general, if I wanted to add WooCommerce functionality to my theme, where do I find documentation regarding the functions to use? For example, since I already have working “product” templates, if I only wanted to test availability, display prices and add an add to cart button? For the cart and checkout pages, I’ll gladly start with the default templates, since these would be new additions anyway …

    Thread Starter omeld

    (@omeld)

    I’ve finally found the solution! The problem is described here and is related to posts_per_page not being passed on correctly.

    My solution was to add a pre_get_posts filter:

    add_action('pre_get_posts', 'my_correct_posts_per_page', 1);
    function my_correct_posts_per_page($query) {
    	if (is_tax('series')) {
    		$query->set('posts_per_page', 9);
    		return;
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)