Displaying the Advertise Widget Only on Free Accounts

This topic contains 4 replies, has 2 voices, and was last updated by  headway 9 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #31071

    headway
    Free User
    Post count: 49

    Is there any way to have the Advertise widget only displayed for free accounts? So if a user upgrades an account, they no longer have advertisements on their profile.

    Thanks.

    #31112

    Simone
    Expired Member
    Post count: 3515

    Hello, download a plug called Widget Logic (here), once installed you’ll find an option in the widgets you have. Drag the desired widget into your desired area, and add the following code in the widget logic field:

    geodir_get_post_package_info_on_listing('', '', 'gd_place')->pid=="1"

    change gd_place to whatever is your post type, and change the “1” to the ID of the price package you want to display the widget. You can see this ID in the Price tab, Package ID column.

    Tested on my demo site and working, let me know 🙂

    #31298

    headway
    Free User
    Post count: 49

    I used the code you supplied as is (my category is gd_place and the free package is also ID 1), but the widget is still displaying for all packages.

    #31308

    Simone
    Expired Member
    Post count: 3515

    Use the following code:

    
    
    global $post, $wp_query, $geodirectory;
    return $post->package_id=="1";

    where 1 is the free package

    #31333

    headway
    Free User
    Post count: 49

    Perfect. Thank you.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket