Results 1 to 1 of 1

Thread: add a sold class to post-block-out, optimize code

  1. #1
    Thread Starter
    ideasconnecting's Avatar
    Join Date
    Nov 2011
    Location
    Denmark
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    add a sold class to post-block-out, optimize code

    I want to add a class 'sold' to post-block-out.
    I have reused some code from an "ad a sold tag to add" tutorial, and it works - but it looks wrong

    PHP Code:
    <?php if (get_post_meta($post->ID'cp_ad_sold'true) == 'yes') : ?> sold<?php endif; ?>
    isn't there a better way, like check if cp_ad_sold = true, then echo 'sold'? or is the above snippet the way to go?

    /phpnewbie

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Code to Block people from Abusing Adsense?
    By TheSyndicate in forum WordPress General Discussion
    Replies: 5
    Last Post: September 7th, 2012, 03:19 PM
  2. If sold - block comments on ads
    By drabello in forum ClassiPress General Discussion
    Replies: 11
    Last Post: July 10th, 2012, 11:34 AM
  3. Place the date of the post in front of the post imige in post block
    By dragos in forum ClassiPress General Discussion
    Replies: 2
    Last Post: December 6th, 2011, 05:50 AM
  4. Place the date of the post in front of the post imige in post block
    By dragos in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: December 5th, 2011, 08:50 AM
  5. [MOD NEEDED] marked as code for ads sold
    By quim in forum ClassiPress General Discussion
    Replies: 2
    Last Post: August 12th, 2011, 04:29 PM