Support » Plugins » Hacks » Dynamic line height on post title

  • Im using this code to dynamically create random font size of the post titles on the front page.
    http://pastebin.com/itYGXAkS

    However is there a way to do so that when the font size is 32 I can have a different lineheight from the lineheigth when the font size is 44?

Viewing 1 replies (of 1 total)
  • simple example based on what you already have:

    <?php
    $font_size = array(32,44);
    $font_size = $font_size[array_rand($font_size)];
    
    if($font_size == "32"){
    	$line_height = "40";
    } else {
    	$line_height = "50";
    }
    
    echo 'font-size: '.$font_size.'px';
    echo 'line-height: '.$line_height.'px';
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic line height on post title’ is closed to new replies.