• Hi!

    I am using the great EM-Plugin. Thanks for that ;).

    My Problem is: Every Event should be shown as a POST with a different Category-Background-Color.

    I have used following Code:

    function return_category_color() {
    if ( has_category( 'party' )) {
    echo "color-party";
    return;} 
    
    elseif ( has_category( 'oclub' ))
    {echo "color-oclub";
    return;}
    
    elseif ( has_category( 'kino' ))
    {echo "color-kino";
    return;}
    
    elseif ( has_category( 'fdm' ))
    {echo "color-fdm";
    return;}
    
    elseif ( has_category( 'konzert' ))
    {echo "color-konzert";
    return;}
    
    elseif ( has_category( 'kiko' ))
    {echo "color-kiko";
    return;}
    
    elseif ( has_category( 'restau' ))
    {echo "color-restau";
    return;}
    
    elseif ( has_category( 'tanzkurs' ))
    {echo "color-tanzkurs";
    return;}
    
    else {
    echo "color-party";
    return;
    }
    }

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    AND:

    .color-party { background: #336699; color: #fafafa;}
    .color-oclub { background: #ffcc00; color: #000000; }
    .color-kino { background: #444444; color: #000000; }
    .color-fdm { background: #777777; color: #000000; }
    .color-konzert { background: #222222; color: #000000; }
    .color-kiko { background: #ccccff; color: #000000; }
    .color-restau { background: #ccccff; color: #000000; }
    .color-tanzkurs { background: #ccccff; color: #000000; }

    Now i am c o m p l e t e l y off, because i dont were i could place these Codes to. I have tried different .php and .css, but nothing worked… If someone can help, it would keep me getting squared eyes ??

    Thanks Folks!
    Cy.

  • The topic ‘Events Manager / Background-Color for Categories’ is closed to new replies.