• Resolved Beee

    (@beee)


    Is it possible to use attributes on a condition ?

    I read this post and read this page but it doesn’t help me.

    As an example, please look at this post.

    On the bottom you see a logo for findhills, which is generated from a custom field.

    I would like to add it below the location of the event, but I can’t use custom fields there, so I would need an attribute, but not all events will get track info, so I don’t add it, the image links to nothing.

    In the full calender I use this attribute:
    #_ATT{shortname}{#_EVENTNAME}
    which works nicely.

    but I need something like

    if #_ATT{x} {
      <div><a href="#_ATT{x}"><img src="logo" alt="" /></a></div>
    }

    http://wordpress.org/extend/plugins/events-manager/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Beee

    (@beee)

    I read and partially understand it, but don’t understand yet where to add the code to call

    <div><a href="#_ATT{x}"><img src="logo" alt="" /></a></div>

    if is true

    paste it in your theme functions.php then you can used it in Events > Settings > Formatting > Events

    e.g.

    {has_x}
    <div><a href="#_ATT{x}"><img src="logo" alt="" /></a></div>
    {/has_x}

    Thread Starter Beee

    (@beee)

    that worked splendidly ! muchos gracias…

    Thread Starter Beee

    (@beee)

    I also tried this for locations with the use of the code that helped me before: http://pastebin.com/Aaknn6PH

    I created #_LATT{website} and copied the forementioned code and changed it how I thought it had to be changed, into this code.

    But can’t get it to work. Any tips/suggestions ?

    I think it might be in

    if( !in_array($args['website'],$EM_Location->event_attributes) && !empty($EM_Location->event_attributes['website']) ){

    but I don’t know…

    Thread Starter Beee

    (@beee)

    because I get this error if I use it.

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/user/domains/domain.nl/public_html/wp-content/themes/yidb_v1/functions.php on line 17 which is the line in the previous post.

    Thread Starter Beee

    (@beee)

    because I get this error if I use it.

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/user/domains/domain.nl/public_html/wp-content/themes/yidb_v1/functions.php on line 17 which is the line in the previous post.
    Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    try to replace the following

    em_event_output_condition => em_location_output_condition
    $EM_Event => $EM_Location
    $EM_Location->event_attributes => $EM_Location->location_attributes

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conditional attribute ?’ is closed to new replies.