Results 1 to 3 of 3

Thread: Help Needed: Hide 'Post ad button' if user already logged in and one ad posted

  1. #1
    Thread Starter
    compunetitcc's Avatar
    Join Date
    Nov 2012
    Location
    South Africa
    Posts
    162
    Thanks
    35
    Thanked 4 Times in 3 Posts

    Help Needed: Hide 'Post ad button' if user already logged in and one ad posted

    Hi, I want to hide the 'Post ad Button' if the user already has one ad listed. This is the code. Works for when user not logged in.

    PHP Code:
           <?php $other_items = new WP_Query( array( 'posts_per_page' => 5'post_type' => APP_POST_TYPE'post_status' => 'publish''author' => get_the_author_meta('ID'), 'orderby' => 'rand''post__not_in' => array( $post->ID ), 'no_found_rows' => true ) ); ?>             
                          
          <?php if ( is_user_logged_in() || $other_items == '0'
                 { 
    ?>
                                 <a href="<?php echo CP_ADD_NEW_URL?>" class="obtn btn_orange"><?php _e'Post FREE Profile'APP_TD ); ?></a>
          <?php } else { ?>

          <?php ?>

  2. #2
    100d's Avatar
    Join Date
    Jul 2012
    Location
    Vancouver, BC
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    compunetitcc's Avatar
    Join Date
    Nov 2012
    Location
    South Africa
    Posts
    162
    Thanks
    35
    Thanked 4 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [MOD NEEDED] Hide custom field if user not logged in
    By tkddroid in forum ClassiPress General Discussion
    Replies: 6
    Last Post: June 27th, 2013, 08:43 AM
  2. Remove Orange "Post an Ad" Button Unless Logged in to Site
    By mbaldwin333 in forum ClassiPress General Discussion
    Replies: 5
    Last Post: December 10th, 2012, 05:07 PM
  3. [MOD NEEDED] If logged in show post a ad button else show sign up button?
    By zuko in forum ClassiPress General Discussion
    Replies: 1
    Last Post: June 29th, 2012, 08:59 AM