Home Forums Plugin Support WP User Frontend Pro different loop, post free to pay

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Roberto 4 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19590

    Roberto
    Member
    Post count: 16

    hi

    I'm trying to differentiate payment different background color for pay per post to no pay (free), for example. If you can help me as I make query_post for difference for user purchase pack_id = 1 (free) normal post and user purchase pack_id = 2 (20 €) feature post, in the loop

    thanks

    Sorry for my english no good

    #19621

    Oritro Ahmed
    Spectator
    Post count: 155

    Hello Roberto,

    Sorry to say, But we are confused about what you've asked. What we understood from your post is,

    if its a paid post, The Background color will be different ( lets say white ).

    And if its not paid, then the background color will be something else ( lets say red ).

    is that what you are asking?

    #20557

    Roberto
    Member
    Post count: 16

    Sorry for the delay, I had almost abandoned the project for this issue.

    Yes, that's exactly what I need.

    If I change the background and if possible put the first paid position that would be an amazing solution, so I thought in different loops.

    Thank you very much!

    #20608

    Oritro Ahmed
    Spectator
    Post count: 155

    Hello Roberto,

    Paste this code in your themes functions.php, it will be done.

    function wpuf_paid_filter($classes) {
    	    global $post;
    	    $key = '_wpuf_order_id';
                $wpufmeta = get_post_meta($post->ID, $key, TRUE);
            
            if ($wpufmeta != ' '){
            $class[] = 'paid';
            } else {
            $class[] = 'free';
            } 
            return $class;
      }
      
    add_filter('post_class', 'wpuf_paid_filter');
    #20725

    Roberto
    Member
    Post count: 16

    I'll try this solution

    Thank you very much.

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

The topic ‘different loop, post free to pay’ is closed to new replies.