Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author TC.K

    (@wp_dummy)

    There are some workaround.

    Depends on what type is your field, if it is taxonomy field you need to use uwpqsf_tax_field_dropdown(), and if it is meta field then you need to use uwpqsf_cmf_field_dropdown()

    eg:

    add_filter('uwpqsf_tax_field_dropdown','add_text_between','');
    function add_text_between($html){
     if($taxname  == 'taxo1'){// if taxo1 is the taxonomy slug
     $html .= '<span>IN</span>'; //adding text here
     }
      //elseif if you multiple field that like to insert text
      return $html;
    
    }

    Above code will become (dropdown[taxo1] ) IN (dropdown).

    Thread Starter guit4eva

    (@guit4eva)

    Hey there:)

    Unfortunately, when I place that in my functions.php file, I get the following error:

    Parse error: syntax error, unexpected ‘)’ in /var/www/find/wp-content/themes/find/functions.php on line 210

    My search is laid out like so:

    Search all Custom Post Type pages in Custom Taxonomy

    Thread Starter guit4eva

    (@guit4eva)

    Update: Sorry, that looks like it was an error on my part. Your code is working…almost:) I just need to do a bit more messing around on my end, but thanks so much! ??

    Thread Starter guit4eva

    (@guit4eva)

    Update 2:)

    Am I suppose to substitute $taxname with something? If I put

    if($taxname != ‘location’){// if taxo1 is the taxonomy slug

    then it “works”, but obviously produced duplicates. “location” is definitely the slug, so I’mg going wrong somewhere else…Do you have any idea?

    Plugin Author TC.K

    (@wp_dummy)

    Why don’t you use == instead of !=, because when you use !=, any taxonomy fields which is not ‘location’ will have the text appended.

    Thread Starter guit4eva

    (@guit4eva)

    I was using != just to check that it’s working. But now I am trying to target the one field with ==, but it’s not working.

    My custom type’s slug is ‘location’, which I used in the functions snippet with ==, but it’s not working for some reason :/

    Plugin Author TC.K

    (@wp_dummy)

    The above code only work for TAXONOMY field, not for custom post type.
    Where does the post type come from??

    Thread Starter guit4eva

    (@guit4eva)

    It’s a custom post type made with WP-Types

    Plugin Author TC.K

    (@wp_dummy)

    By default, the custom post type will not displayed at the search form. How you get the post type in the search form?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Separate fields in template’ is closed to new replies.