• Resolved alexcosta

    (@alexcosta)


    Hi there,

    I have a post_class() template tag in my index.php template that i would like to add a custom class which is generated by my admin options.

    The post_class() should output like this:
    <div <?php post_class( classFoo class2 );?>>

    Now, classFoo is generated by my options page but i don’t know how to add it to the template tag dynamically. class2 is already in the tag.

    Here’s what i got now:

    This echoes the classFoo
    <?php echo $smof_data['custom_class'];?>

    i tried added it to post_class() like:
    <div <?php post_class( 'echo $smof_data['custom_class'] class2');?>>
    but obviously it doesn’t work.

    Php is not my strength.
    I suspect this must be a easy thing to accomplish.

    Can anybody please please please help?

    Cheers Alex

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Little help with post_class( ) template tag’ is closed to new replies.