Remove YES from checkbox options display

This topic contains 10 replies, has 5 voices, and was last updated by  Kiran 5 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #489782

    Fulvio Di Stefano
    Lifetime Member
    Post count: 134

    I want to remove :yes from the front end display of the checked options, tried to remove it with CSS but no workaround. any idea how to go about it, I don’t have much time to go through the files at the moment

    #489783

    Kor
    Moderator
    Post count: 16516

    Hi Fulvio,

    Thanks for your post. Could you share the URL of the page in question so that we could take a better look at it?

    Thanks!

    #489784

    Fulvio Di Stefano
    Lifetime Member
    Post count: 134
    This reply has been marked as private.
    #489790

    Alex Rollin
    Moderator
    Post count: 27815

    Hi,

    something like this CSS will remove the first one, but, it won’t remove the colon which is part of the field label.

    
    
    
    #et-boc > div > div.et_pb_row.et_pb_row_0 > div > div > div:nth-child(1) > div > font > font {
        display: none;
    }
    

    If you don’t want it to say “: Yes” then, instead of using GD Post Meta, there in the template, just write the text you want (Field Label).

    #489796

    Fulvio Di Stefano
    Lifetime Member
    Post count: 134

    Doesn’t work, I think removing it entirely from the plugin files would be better, css seems not to work

    #489837

    Paolo
    Site Admin
    Post count: 31211

    I don’t think is possible to remove it from the plugin. I asked to the developers to check if there is a filter that we can use to hide the “: YES” part or at least to wrap it with proper HTML so that we can hide it with CSS.

    Thanks

    #489855

    Fulvio Di Stefano
    Lifetime Member
    Post count: 134

    Please ask your moderator kiran to update the code in this link to work in the latest WordPress version.
    https://wpgeodirectory.com/support/topic/show-checkbox-results-without-yes/

    #489857

    Alex Rollin
    Moderator
    Post count: 27815

    You can do what you want with a badge, with the conditional set to yes, then show the text/value you want.

    Examples are here:
    https://wpgeodirectory.com/docs-v2/faq/common-examples/#gd_post_badge

    #489870

    Fulvio Di Stefano
    Lifetime Member
    Post count: 134

    So you’re suggesting I stop using checkbox custom field?

    #489877

    Alex Rollin
    Moderator
    Post count: 27815

    Not at all. What I mean is you can use a Badge to output the value you want when that field is Yes or No.

    #489989

    Kiran
    Moderator
    Post count: 7069

    Hi Fulvio,

    Try following snippet to remove “: Yes” from checkbox field value display.

    
    
    function gd_snippet_300519_remove_checkbox_yes( $html, $location, $cf, $p = '', $output = '' ) {
    	if ( $html != '' ) {
    		$html = str_replace( ': </span></span>Yes</div>', '</span></span></div>', $html );
    		$html = str_replace( '</span>Yes</div>', '</span></div>', $html );
    	}
    
    	return $html;
    }
    add_filter( 'geodir_custom_field_output_checkbox', 'gd_snippet_300519_remove_checkbox_yes', 11, 5 );

    Kiran

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount