different loop, post free to pay

This topic contains 4 reply and 2 voices, and was last updated by Roberto 9 years, 11 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
April 29, 2014 at 1:38 pm 19590
Roberto 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
April 29, 2014 at 6:00 pm 19621
Oritro Ahmed Oritro Ahmed

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?

May 16, 2014 at 3:45 pm 20557
Roberto Roberto

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!

May 17, 2014 at 6:23 pm 20608
Oritro Ahmed Oritro Ahmed

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');
May 20, 2014 at 1:29 pm 20725
Roberto Roberto

I’ll try this solution

Thank you very much.

Viewing 4 Posts - 1 through 4 (of 4 total)