-
AuthorPosts
-
September 5, 2017 at 4:26 pm #848181
Hi,
i try to custom the archive.php file for category. I see on multiple post here that we can’t custom it by the administrator panel.
https://kriesi.at/support/topic/customise-category-page/
And also see this trick http://kriesi.at/documentation/enfold/change-archive-categorytag-blog-style/The blog-grid layout fit perfectly but I want to modify the order and the number of display post. There is a way to do this in the archive.php file or with a hook / filter ?
Thx
- This topic was modified 7 years, 2 months ago by leplusweb.
September 7, 2017 at 1:50 pm #849096Hey leplusweb,
Please refer to this post – http://kriesi.at/documentation/enfold/change-archive-categorytag-blog-style/ and switch archive style to Grid and then elaborate on the changes you would like to make :)
Best regards,
YigitSeptember 7, 2017 at 2:12 pm #849101Hey,
this link is in my post :)
I don’t see how can I modify the order and the number of displaying post.
Thx
September 8, 2017 at 5:56 pm #849668Hi,
Please add following code to Functions.php file in Appearance > Editor
function avia_post_slide_query_mod( $query, $params ) { if(is_archive()){ $query['orderby'] = 'date'; $query['order'] = 'ASC'; $query['posts_per_page'] = 5; } return $query; } add_filter( 'avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2);
Best regards,
YigitSeptember 8, 2017 at 6:39 pm #849681Hi,
thx i add it to the functions.php of my child theme and it’s work. I can display post in good order.
But, if i change the [‘posts_per_page’] parameter to any number superior to 10 the page display only 10 result.
Strange isn’t it ?
Below my code (The echo archive display 1)
function avia_post_slide_query_mod( $query, $params ) { // echo "archive".is_archive(); if(is_archive()){ $query['orderby'] = 'title'; $query['order'] = 'ASC'; $query['posts_per_page'] = 12; } return $query; } add_filter( 'avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2);
Thx for your help to solve this
September 9, 2017 at 8:52 am #849893Hi,
I think the number of posts comes from your setting under Settings->Reading. Try to increase the value there.
Best regards,
RikardSeptember 11, 2017 at 10:24 am #850403Hi,
correct, the value in Settings / Reading was set to 10.
This solves my problem.
Thx for your help
Regards
September 11, 2017 at 11:33 am #850424Hi,
You are welcome! :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Best regards,
Yigit -
AuthorPosts
- The topic ‘Custom archive.php’ is closed to new replies.