Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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, 3 months ago by leplusweb.
    #849096

    Hey 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,
    Yigit

    #849101

    Hey,

    this link is in my post :)

    I don’t see how can I modify the order and the number of displaying post.

    Thx

    #849668

    Hi,

    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,
    Yigit

    #849681

    Hi,

    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

    #849893

    Hi,

    I think the number of posts comes from your setting under Settings->Reading. Try to increase the value there.

    Best regards,
    Rikard

    #850403

    Hi,

    correct, the value in Settings / Reading was set to 10.

    This solves my problem.

    Thx for your help

    Regards

    #850424

    Hi,

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Custom archive.php’ is closed to new replies.