New Landing How can we help? Themeforest Theme Support Uplift Related articles columns

Viewing 7 posts - 1 through 7 (of 7 total)
  • Posted in: Uplift
  • #330467
    welcome
    Member
    Post count: 88

    Hello,

    Is it possible to get the related articles on 4 columns ?

    Thanks a lot

    #330682
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    You mean the related items on a single post?

    Uplift has a filter for the related posts columns sf_related_posts_item_class, knowing this you can write a function to change the filter output.

    Please install and activate the supplied child theme, inside the child theme functions.php file paste this:

      function uplift_custom_related_posts_four_columns() {
        return 'col-sm-3';
      }
      add_filter('sf_related_posts_item_class', 'uplift_custom_related_posts_four_columns');
    #330755
    welcome
    Member
    Post count: 88

    Hi David,

    Yes, I would like 4 related items instead of 3.

    Salle pour 19 élèves

    I pasted the code in functions.php, but I don’t see any changes.
    Do I something wrong?

    Thanks a lot

    #330756
    welcome
    Member
    Post count: 88
    This reply has been marked as private.
    #330764
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    I had to increase the action priority so the function fired later. The updated code is:

      function uplift_custom_related_posts_four_columns() {
        return 'col-sm-3';
      }
      add_filter('sf_related_posts_item_class', 'uplift_custom_related_posts_four_columns', 100);
    #330779
    welcome
    Member
    Post count: 88

    Thank you very much!
    Have a nice day!

    #330780
    David Martin – Support
    Moderator
    Post count: 20834

    Glad to help you out!

    If you have found the theme/support useful, we appreciate it if you can leave feedback on our item if you have the time as it really helps us out.

    Thanks,
    David

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register