• Resolved parkratbrew

    (@parkratbrew)


    /Hi,

    I’m trying to use the [display-if-get option with WordPress 4.3.1.

    I’d like to pass a parameter that selects one of a number of options in a SELECT tag.

    However, for this input:

    <SELECT NAME="recipients" SIZE=1>
    	<OPTION value="generalinfo"
    [display-if-get name="recipient" value="generalinfo"]
    selected
    [/display-if-get]
    	  	>General Information</OPTION>
    	<OPTION value="volunteer"
    [display-if-get name="recipient" value="volunteer"]
    selected
    [/display-if-get]
    	  	>Volunteer Coordinator</OPTION>
    	<OPTION value="webmaster"
    [display-if-get name="recipient" value="webmaster"]
    selected
    [/display-if-get]
    	  	>Website Comments</OPTION>
    	<OPTION value="mailinglist"
    </SELECT>

    This is the output in View Source. The conditional text is shown in all the lines along with the closing [/display-if-get]. And, since selected is present in all the options, the last one is always chosen.

    <SELECT NAME="recipients" SIZE=1>
    	<OPTION value="generalinfo"
    
    selected
    [/display-if-get]
    	  	>General Information</OPTION>
    	<OPTION value="volunteer"
    
    selected
    [/display-if-get]
    	  	>Volunteer Coordinator</OPTION>
    	<OPTION value="webmaster"
    
    selected
    [/display-if-get]
    	  	>Website Comments</OPTION>
    	<OPTION value="mailinglist"
    </SELECT>

    [display-get-param “recipient”] correctly displays the passed parameter.

    Is there some limitation as to the number of [display-if-get..]s? or some other syntactical problem?

    Thanks.

    https://www.ads-software.com/plugins/get-params/

Viewing 1 replies (of 1 total)
  • Sorry – I only just picked this up (support is normally via email).

    Did you find a solution?

    I don’t think there should be a problem adding multiple display-if-gets on a page, but I wonder if there is a problem to do with the way WordPress interprets shortcodes.

    Maybe it doesn’t like them being mixed into the HTML….?

    Thanks,

    Dan

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with [display-if-get]’ is closed to new replies.