Hi,
I’m trying to hide the category selector in the add place form ONLY FOR SOME PRICE PACKAGES.
I already had this fonction to create a different class for each packages :
// 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;
}
(I know it works because I’m using this classes for hiding something else)
I added this CSS :
.gd-package-id-10 #gd_placecategory_row {
display: none;
}
But doesn’t work and no idea what’s wrong on it.
As it is a customisation I can paye if someone find the solution 🙂
Just for information, I want to hide it for some packages because they have only 1 category and I did an automatique selection
Here is the code I added to the “Footer script code” (works perfectly):
jQuery(document).ready(function(){
if(location.pathname == “/add-listing/”)
{
$price_id = jQuery(‘[name=”package_id”]:checked’).val();
if($price_id == 1)
{
jQuery(‘#gd_placecategory.chosen_select’).val(’68’).change();
setTimeout(function()
{
jQuery(‘input[name = post_default_category][value = 68]’).attr(“checked”, “checked”);
}, 2000);
}
Thanks in advance !
Clem