Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #835845

    Dear Kriesi team,

    in the blog there is this prev and next function. I would like to have the behaviour, that it “stays” within one category. Perfect would be no arrow at the first and last article.

    I found this funcion here in the forum:

    /* Blätterfunktion in Blog & Presse nur innerhalb der eigenen Kategorie */
    add_filter(‘avia_post_nav_categories’, ‘use_same_category_filter’);
    function use_same_category_filter($same_category)
    {
    $same_category = true;
    return $same_category;
    }

    But it doesn’t work and sticks to chronological sorting.

    How can I fix this?

    Thank you in advance!
    Kati

    #837769

    Hey prudsys,

    Can you give us temporary admin access as well as ftp access? so we can try to check why it doesn’t work.

    Best regards,
    Nikko

    #839752

    Sorry Nikko,

    it took me a while to get access for you. Here we are.

    The code above is in the functions.php of our chilt theme.

    Regards,
    Kati

    #842172

    Hi,

    I just tried the code and it is working properly.
    The function has not changed at all, so there is something wrong on your implementation.
    Please do make sure that you paste the code on functions.php file.

    Thank you for your understanding

    Best regards,
    Basilis

    #842355

    Hi Basilis,

    thanks for your effort. The function _IS_ in functions.php but not working. Did you have a look at our functions.php? Maybe something in there stops the code from working properly? I tried position at the end and in the beginning of functions.php but it mixes categories. :(

    Regards,
    Kati

    #843478

    Hey Basilis,

    this piece of code seems to work for us:
    add_filter(‘avia_post_nav_settings’,’avia_same_category_filter’, 10, 1);
    function avia_same_category_filter($settings)
    {
    $settings[‘same_category’] = true;
    return $settings;
    }
    I also found it in your forum here, so thank you anyway.

    Best regards,
    Kati

    #843803

    Hi,

    Glad you found the filter. Yes, it will filter posts from the same category. Note that it will work better if the posts don’t belong to multiple categories.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.