• Resolved Anonymous User 13716511

    (@anonymized-13716511)


    I would like to hide the taxonomy category title completely.
    all_items_labels allows me to change it but how do I hide it?
    all_items_labels=",," doesn’t do anything.
    eg remove <option value='0' selected='selected'>Tour Length</option>
    from

    <option value='0' selected='selected'>Tour Length</option>
    	<option class="level-0" value="15">Full Day</option>
    	<option class="level-0" value="14">Half Day</option>

    Thanks

    https://ww.wp.xz.cn/plugins/search-filter/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Ross Morsali

    (@designsandcode)

    [pasted from other discussion]

    Hi LucyTech

    There isn’t an option to do this with the plugin I’ll explain:

    If you remove this option from the list, then whenever you load a page with this shortcode in “Full Day” will always be selected.

    Most people using this plugin will use it on a specific search page, which will show all results by default.

    Therefor, having the setting to “Full Day” when the page is showing results for all days is actually incorrect and not providing a good experience for a user.

    Can you explain your scenario so I can understand why you would need to do this? πŸ™‚

    Alternatively, you could use Javascript to hide this option – http://stackoverflow.com/questions/1271503/hide-options-in-a-select-list-using-jquery

    ——–

    In addition to this, all_items_labels` is used to rename the label manually – but not remove it.

    Thanks

    Thread Starter Anonymous User 13716511

    (@anonymized-13716511)

    I want the title to be above the select list and an item selected by default, say ‘Full day’ and if the user wants they can change it.
    This looks better then having the same label listed twice.

    I’m using the plugin to search for a tour on the site. I have three drop downs, ‘Method of Travel’, ‘Length of trip’ and ‘Area of interest’. The user needs to select one from each and then possible trip options are shown.
    I don’t want the labels included in the options – they don’t mean anything. It is better for me to have a default selected choice
    eg ‘car’, ‘full day’, ‘historical site’ then to have the labels selected eg ‘method’, ‘length’ and ‘area’.
    Does that explain why I would want this feature?

    Plugin Author Ross Morsali

    (@designsandcode)

    Ahhh yesss I get it now.

    So what you are looking to do is a little more than simply hide the label, but in fact have a default selected and to be able to exclude options from your dropdowns

    I’m currently developing a premium version which has nice admin UI where I will include the exclude functionality.

    I haven’t even begun to think how I would do the default selection stuff though but will look in to it.

    Sorry can’t be of more help right now :/

    Thread Starter Anonymous User 13716511

    (@anonymized-13716511)

    I don’t mind if another option isn’t selected by default but that would happen if I didn’t have a label right? Or at least the top one would become the selected one?
    Is there a way to just hide it with css?
    I managed a radio button one hide one with

    #content > form > div > ul > li:nth-child(3) > ul > li:nth-child(1) > label{
    display:none;
    }

    but it is a bit general. I can’t figure out how the select ones would work. My page is http://mg-testsite.com/maps/kinar_tourist_site/

    Thanks

    Plugin Author Ross Morsali

    (@designsandcode)

    Yeah basically it would be the top one that is selected, but your results, without submitting the search form would be shown without any search criteria applied.

    I had a quick look about doing this in CSS and it doesn’t look like there is a good cross browser way of doing this – see this post – http://stackoverflow.com/questions/9234830/how-to-hide-a-option-in-a-select-menu-with-css

    I just did a test and this works:

    jQuery('.searchandfilter ul li > select option:first-child').remove();

    So add that to the JS of your theme πŸ™‚

    Thread Starter Anonymous User 13716511

    (@anonymized-13716511)

    amazing! It works for the select options. How can I change it for radio buttons?

    I tried
    jQuery('.searchandfilter ul li > radio:first-child').remove();
    but it doesn’t work.
    Thanks

    Plugin Author Ross Morsali

    (@designsandcode)

    Hey yeah it would be something like

    jQuery('.searchandfilter ul li > input[type=radio]:first-child').remove();

    Let me know

    Thread Starter Anonymous User 13716511

    (@anonymized-13716511)

    That code doesn’t seem to be working. I also tried

    jQuery('.searchandfilter label ul li > input[type=radio]:first-child').remove();

    jQuery('.searchandfilter ul li > label input[type=radio]:first-child').remove();
    with no luck.
    I am getting errors in the console :
    Uncaught TypeError: object is not a function functions.js:8
    (anonymous function) functions.js:8
    (anonymous function)
    and
    Uncaught ReferenceError: removeselect is not defined (index):97
    (anonymous function)
    I’m not sure what it means.
    my code is

    ( function( $ ) {
    // hide first select option on step one archive-kinar_tourist_sites.php
    	$( function removeselect(){
    		jQuery('.searchandfilter ul li > select option:first-child').remove();
    		}
    	)();
    
    	$( function removeradio(){
    		jQuery('.searchandfilter label ul li > input[type=radio]:first-child').remove();
    		}
    	)();
    } ) (jQuery);

    Thanks

    Plugin Author Ross Morsali

    (@designsandcode)

    Woooahhh not sure what your code above is supposed it has got a lot of errors.

    You need to read up on some tutorials on JS if you want to make modifications yourself.

    This is what you need to remove the first radio button with the label in your form

    jQuery(‘.searchandfilter ul li > ul > li:first-child’).remove();

    If you like the plugin please leave a rating πŸ™‚

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘all_items_labels’ is closed to new replies.