Hi,
on my website users can add their listing and they can choose a free package or a premium package. After this I would like the ONLY users that have already subscribed a premium packgage can see some element on the website like for example the “add event” button or the “add event” page.
I added on my function.php this script that should assign a category to each package
// add the package id to the body
add_filter( 'body_class', 'my_add_package_class',10,1 );
function my_add_package_class($class){
global $post;
if (geodir_is_page('detail') && isset($post->package_id)) {
$class[] = "gd-package-id-".$post->package_id;
}
return $class;
}
Then I added a category .evento to the “add event” button and I wrote this css rules
.gd-package-id-25 .evento {
display: block !important;
}
.evento {
display: none;
}
In order tho hide the button for everyone but to show it for users that have the premium package (with the id #25).
But it doesn’t work, I don’t know why.