Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter Siddharth

    (@siddhus212)

    I am not saying to write the code for me. I will do that. I tried with the code you have given previously. With that I was able to hide one or more tabs but they are applied to all the posts. I couldn’t hide tab for particular post. I will be thankful to you if you can give link to some simplified code to hide the map tab from particular posts.

    I am waiting for the next release to see star ratings working perfectly.

    Plugin Author Paolo

    (@paoltaia)

    I’ve already given you the code:

    <?php
    $post='99' //assuming you want to hide it for listing with id=99
    if(is_single($post)){ //paste the function to hide the tab here } ?>

    Thanks

    Thread Starter Siddharth

    (@siddhus212)

    I tried using if(is_single($post)) as well but still it gets applied to all the listings instead of stated postid.

    Plugin Author Paolo

    (@paoltaia)

    Hi Siddharth,

    assuming the post ID where you want to hide the map is 2981, this would be how to do it.

    add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
     // here u can modify this array, u can create a completely new one too.
         if(isset($tab_array['post_profile'])){
             $new_tab_array['post_profile'] = $tab_array['post_profile']; // set in new array
    		 unset($tab_array['post_profile']);//unset in old one
    	 }
    
         if(isset($tab_array['post_map'])){
            if(is_single(2981)){} else {
    		 $new_tab_array['post_map'] = $tab_array['post_map'];// set in new array
    }
    		 unset($tab_array['post_map']);//unset in old one
    	 }
    
        if(isset($tab_array['special_offers'])){
             $new_tab_array['special_offers'] = $tab_array['special_offers'];// set in new array
    		 unset($tab_array['special_offers']);//unset in old one
    	}
    
         if(isset($tab_array['post_info'])){
             $new_tab_array['post_info'] = $tab_array['post_info'];// set in new array
    		 unset($tab_array['post_info']);//unset in old one
    	 }
    
        if(isset($tab_array['post_images'])){
             $new_tab_array['post_images'] = $tab_array['post_images'];// set in new array
    		 unset($tab_array['post_images']);//unset in old one
    	}
    
        if(isset($tab_array['post_video'])){
             $new_tab_array['post_video'] = $tab_array['post_video'];// set in new array
    		 unset($tab_array['post_video']);//unset in old one
    	}
    
         if(isset($tab_array['special_offers'])){
             $new_tab_array['special_offers'] = $tab_array['special_offers'];// set in new array
    		 unset($tab_array['special_offers']);//unset in old one
    	 }
    
         if(isset($tab_array['reviews'])){
             $new_tab_array['reviews'] = $tab_array['reviews'];// set in new array
    		 unset($tab_array['reviews']);//unset in old one
    	 }
    
        if(isset($tab_array['related_listing'])){
            $new_tab_array['related_listing'] = $tab_array['related_listing'];// set in new array
    		unset($tab_array['related_listing']);//unset in old one
    	}
    
    	// now we set any remaining tabs that have not been assigned an order
    	foreach($tab_array as $key=>$tab){
    	$new_tab_array[$key]=$tab;
    	}
    
        return $new_tab_array ;
    }

    I’ve tested it and it works.

    I hope you realize this goes way beyond support and for further customizations, I’d kindly ask to find yourself a developer that can help you creating your custom functions.

    Thank you

    Thread Starter Siddharth

    (@siddhus212)

    Actually I had done everything right. Only there was one difference.

    I did following:
    <?php
    $post=’356′;
    if(is_single($post)){ function } ?>

    You did following:
    <?php
    if(is_single(356)){ function } ?>

    Because of declaring $post=356 beforehand, map tab used to hide for all the posts instead of post id 356 whereas your code worked fine.

    I had declared $postid=356; before function geodir_detail_page_tab_list_extend($tab_array). I think I should have declared it before if(isset($tab_array[‘post_map’])).

    Anyways thanks for your kind help.

    Thread Starter Siddharth

    (@siddhus212)

    Hi,
    I wanted to remove image from bubble map hence in theme’s style.css I wrote following code,
    div.geodir-bubble_image{
    display: none;
    }

    Now geodir-bubble-meta-side has moved in place of geodir-bubble_image. So to utilise the full space of bubble map I tried fixed width 230px (115px of geodir-bubble-meta-side and 115px of geodir-bubble_image) as well as auto.

    .geodir-bubble-meta-side {
    width: 230px; OR width:auto;
    }

    But this doesn’t work.

    Then in the chrome’s developer mode I tried,
    .geodir-map-small .geodir-bubble_image, .geodir-map-small .geodir-bubble-meta-side {
    width: auto;
    }

    This worked perfectly but when the browser is resized again the same doesn’t work. Also the same doesn’t work when added to theme’s style.css file. So how to fix it?

    Thread Starter Siddharth

    (@siddhus212)

    If I make changes in gd_core_frontend.css then it works. But it isn’t ideal way to make changes in the plugin files. So whats the other way to do it?

    Thread Starter Siddharth

    (@siddhus212)

    Could you please reply to my query?

    Plugin Author Paolo

    (@paoltaia)

    Hi,

    custom css can be added to GeoDirectory >> design >> script >> custom css.

    As far as customizing your css, if you are having trouble getting your website to look as you wish, I can suggest a developer that you can hire to help you out.

    Let us know,

    Thanks

    Thread Starter Siddharth

    (@siddhus212)

    I have tried it in the style.css file. Now I will try adding code in GeoDirectory >> design >> script >> custom css and let you know.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Set Default Location doesn't get the city right’ is closed to new replies.