- This topic has 3 replies, 2 voices, and was last updated 5 years, 9 months ago by .
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Hello, I'm using the Focus Pro theme. I created a custom taxonomy and I duplicated the homepage.php and renamed it to taxonomy-mytax.php to also have the grid look on that taxonomy. Now I am trying to have two special things on that new taxonomy:
1º. Show more posts than normal, so I have written 'posts_per_page' => 40, on the genesis_grid_loop (inside taxonomy-mytax.ph) but it doesn't seem to work.
2º. To order the posts inside the taxonomy by alphabetical order. I have been trying some codes I found online to put on functions.php but also without success.
That would be the two last things I need to make my website perfect, hope you can help me. Thank you in advance!
Someone knows or can tell me more or less where I should start looking? Thanks
How are you passing the filter arguments for to the grid loop? You need to pass two arrays. One for formatting the grid loop, the second to adjust wp_query. This is an example: https://code.garyjones.co.uk/genesis-grid-loop-advanced.
The $grid_args array is the grid loop format. The $query_args array adjusts wp_query. This is where you pass the posts_per_page and orderby values.
Hi Victor and thank you for your help. I was trying to put the posts_per_page in the same array. I made a fast search and fount this article about how to customize the wp_query: http://www.billerickson.net/customize-the-wordpress-query/
And everything is working as expected. Thank you!
© 2022 WPEngine, Inc.